/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('cnip', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ProductComponentRelationDetail {
  appVersion?: string(name='appVersion', description='appVersion'),
  category?: string(name='category', description='category'),
  class?: string(name='class', description='class'),
  componentName?: string(name='componentName', description='componentName'),
  componentOrchestrationValues?: string(name='componentOrchestrationValues', description='componentOrchestrationValues'),
  componentUID?: string(name='componentUID', description='componentUID'),
  componentVersionUID?: string(name='componentVersionUID', description='componentVersionUID'),
  createdAt?: string(name='createdAt', description='createdAt'),
  description?: string(name='description', description='description'),
  documents?: string(name='documents', description='documents'),
  enable?: boolean(name='enable', description='enable'),
  imagesMapping?: string(name='imagesMapping', description='imagesMapping'),
  namespace?: string(name='namespace', description='namespace'),
  orchestrationType?: string(name='orchestrationType', description='orchestrationType'),
  parentComponent?: boolean(name='parentComponent', description='parentComponent'),
  parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID', description='parentComponentVersionRelationUID'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID', description='parentComponentVersionUID'),
  priority?: int32(name='priority', description='priority'),
  productVersionUID?: string(name='productVersionUID', description='productVersionUID'),
  provider?: string(name='provider', description='provider'),
  public?: boolean(name='public', description='public'),
  readme?: string(name='readme', description='readme'),
  relationUID?: string(name='relationUID', description='relationUID'),
  releaseName?: string(name='releaseName', description='releaseName'),
  resources?: string(name='resources', description='resources'),
  sequence?: int32(name='sequence', description='sequence'),
  singleton?: boolean(name='singleton', description='singleton'),
  source?: string(name='source', description='source'),
  version?: string(name='version', description='version'),
}

model FoundationVersion {
  description?: string(name='description', description='description'),
  documents?: string(name='documents', description='documents'),
  name?: string(name='name', description='name'),
  status?: string(name='status', description='status'),
  uid?: string(name='uid', description='uid'),
  version?: string(name='version', description='version'),
  platforms?: [
    Platform
  ](name='platforms', description='platforms'),
}

model Platform {
  architecture?: string(name='architecture', description='architecture'),
  os?: string(name='os', description='os'),
}

model InstanceInfo {
  identifier?: string(name='identifier', description='identifier'),
  hostName?: string(name='hostName', description='hostName'),
  os?: string(name='os', description='os'),
  osVersion?: string(name='osVersion', description='osVersion'),
  arch?: string(name='arch', description='arch'),
  kernel?: string(name='kernel', description='kernel'),
  macAddress?: string(name='macAddress', description='macAddress'),
  cpu?: string(name='cpu', description='cpu'),
  memory?: string(name='memory', description='memory'),
  systemDisk?: [
    Disk
  ](name='systemDisk', description='systemDisk'),
  dataDisk?: [
    Disk
  ](name='dataDisk', description='dataDisk'),
  privateIP?: string(name='privateIP', description='privateIP'),
  publicIP?: string(name='publicIP', description='publicIP'),
  internetBandwidth?: int32(name='internetBandwidth', description='internetBandwidth'),
  networkCards?: [ 
    {
      name?: string(name='name', description='name'),
      ip?: string(name='ip', description='ip'),
    }
  ](name='networkCards', description='networkCards'),
  imageID?: string(name='imageID', description='imageID'),
  instanceType?: string(name='instanceType', description='instanceType'),
  systemInfo?: string(name='systemInfo', description='systemInfo'),
  rootPassword?: string(name='rootPassword', description='rootPassword'),
  labels?: map[string]string(name='labels', description='labels'),
  taints?: [ 
    {
      key?: string(name='key', description='key'),
      value?: string(name='value', description='value'),
      effect?: string(name='effect', description='effect'),
    }
  ](name='taints', description='taints'),
  annotations?: map[string]string(name='annotations', description='annotations'),
}

model Disk {
  name?: string(name='name', description='name'),
  capacity?: int32(name='capacity', description='capacity'),
  remain?: int32(name='remain', description='remain'),
  fsType?: string(name='fsType', description='fsType'),
  mountPoint?: string(name='mountPoint', description='mountPoint'),
  type?: string(name='type', description='type'),
}

model ComponentVersion {
  appVersion?: string(name='appVersion', description='appVersion'),
  componentName?: string(name='componentName', description='componentName'),
  componentUID?: string(name='componentUID', description='componentUID'),
  description?: string(name='description', description='description'),
  documents?: string(name='documents', description='documents'),
  imagesMapping?: string(name='imagesMapping', description='imagesMapping'),
  namespace?: string(name='namespace', description='namespace'),
  orchestrationType?: string(name='orchestrationType', description='orchestrationType'),
  orchestrationValues?: string(name='orchestrationValues', description='orchestrationValues'),
  packageURL?: string(name='packageURL', description='packageURL'),
  parentComponent?: boolean(name='parentComponent', description='parentComponent'),
  platforms?: [
    Platform
  ](name='platforms', description='platforms'),
  readme?: string(name='readme', description='readme'),
  resources?: string(name='resources', description='resources'),
  source?: string(name='source', description='source'),
  uid?: string(name='uid', description='uid'),
  version?: string(name='version', description='version'),
}

model ListAuthorizationHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model ListAuthorizationRequest {
  asGrantee?: boolean(name='asGrantee', description='默认为false, 代表获取作为授权人，授权给其他人的资源列表；如果为true，则返回其他人授权给自己的资源列表'),
  resourceType?: string(name='resourceType'),
  resourceIdentifier?: string(name='resourceIdentifier'),
  pageNum?: long(name='pageNum'),
  pageSize?: long(name='pageSize'),
  sortKey?: string(name='sortKey'),
  sortDirect?: string(name='sortDirect'),
}

model ListAuthorizationResponseBody = {
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  data?: {
    total?: long(name='total'),
    pageSize?: long(name='pageSize'),
    pageNum?: long(name='pageNum'),
    list?: [ 
      {
        createdAt?: string(name='CreatedAt'),
        uid?: string(name='uid'),
        grantor?: string(name='grantor'),
        grantee?: string(name='grantee'),
        resourceType?: string(name='resourceType'),
        resourceIdentifier?: string(name='resourceIdentifier'),
        effect?: string(name='effect'),
        description?: string(name='description'),
      }
    ](name='list'),
  }(name='data'),
}

model ListAuthorizationResponse = {
  headers: map[string]string(name='headers'),
  body: ListAuthorizationResponseBody(name='body'),
}

async function listAuthorization(request: ListAuthorizationRequest): ListAuthorizationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListAuthorizationHeaders{};
  return listAuthorizationWithOptions(request, headers, runtime);
}

async function listAuthorizationWithOptions(request: ListAuthorizationRequest, headers: ListAuthorizationHeaders, runtime: Util.RuntimeOptions): ListAuthorizationResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.asGrantee)) {
    query.asGrantee = request.asGrantee;
  }
  if (!Util.isUnset(request.resourceType)) {
    query.resourceType = request.resourceType;
  }
  if (!Util.isUnset(request.resourceIdentifier)) {
    query.resourceIdentifier = request.resourceIdentifier;
  }
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.sortKey)) {
    query.sortKey = request.sortKey;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query.sortDirect = request.sortDirect;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListAuthorization', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/authorizations`, 'json', req, runtime);
}

model GetEnvironmentResponseBody = {
  data?: {
    clusterId?: string(name='clusterId'),
    createdAt?: string(name='createdAt'),
    description?: string(name='description'),
    instanceList?: [
      InstanceInfo
    ](name='instanceList'),
    location?: string(name='location'),
    name?: string(name='name'),
    platform?: {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }(name='platform'),
    productName?: string(name='productName'),
    productVersion?: string(name='productVersion'),
    uid?: string(name='uid'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType'),
    instanceStatus?: string(name='instanceStatus'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: GetEnvironmentResponseBody(name='body'),
}

async function getEnvironment(uid: string): GetEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentWithOptions(uid, headers, runtime);
}

async function getEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}

model GetProductEnvironmentResponseBody = {
  data?: {
    createdAt?: string(name='CreatedAt'),
    clusterUID?: string(name='clusterUID'),
    description?: string(name='description'),
    instanceList?: [
      InstanceInfo
    ](name='instanceList'),
    instanceStatus?: string(name='instanceStatus'),
    name?: string(name='name'),
    productName?: string(name='productName'),
    productVersion?: string(name='productVersion'),
    productUID?: string(name='productUID'),
    productVersionUID?: string(name='productVersionUID'),
    type?: string(name='type'),
    uid?: string(name='uid'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType'),
    snapshotUID?: string(name='snapshotUID'),
    platform?: Platform(name='platform'),
    platformStatus?: string(name='platformStatus'),
    location?: string(name='location'),
    oldProductVersion?: string(name='oldProductVersion'),
    oldProductVersionUID?: string(name='oldProductVersionUID'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductEnvironmentResponseBody(name='body'),
}

async function getProductEnvironment(uid: string): GetProductEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductEnvironmentWithOptions(uid, headers, runtime);
}

async function getProductEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductEnvironmentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_envs/${uid}`, 'json', req, runtime);
}

model GetProductVersionPackageRequest {
  platform?: string(name='platform'),
  packageType?: string(name='packageType'),
  packageContentType?: string(name='packageContentType'),
  oldProductVersionUID?: string(name='oldProductVersionUID'),
}

model GetProductVersionPackageResponseBody = {
  data?: {
    packageUID?: string(name='packageUID'),
    packageStatus?: string(name='packageStatus'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionPackageResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionPackageResponseBody(name='body'),
}

async function getProductVersionPackage(uid: string, request: GetProductVersionPackageRequest): GetProductVersionPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionPackageWithOptions(uid, request, headers, runtime);
}

async function getProductVersionPackageWithOptions(uid: string, request: GetProductVersionPackageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPackageResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.platform)) {
    query.platform = request.platform;
  }
  if (!Util.isUnset(request.packageType)) {
    query.packageType = request.packageType;
  }
  if (!Util.isUnset(request.packageContentType)) {
    query.packageContentType = request.packageContentType;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    query.oldProductVersionUID = request.oldProductVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetProductVersionPackage', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/packages`, 'json', req, runtime);
}

model UpdateSnapshotInstanceJoinOptionWithBatchRequest {
  instanceUIDs?: string(name='instanceUIDs'),
  joinSnapshot?: boolean(name='joinSnapshot'),
  rootPassword?: string(name='rootPassword'),
}

model UpdateSnapshotInstanceJoinOptionWithBatchResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateSnapshotInstanceJoinOptionWithBatchResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateSnapshotInstanceJoinOptionWithBatchResponseBody(name='body'),
}

async function updateSnapshotInstanceJoinOptionWithBatch(uid: string, request: UpdateSnapshotInstanceJoinOptionWithBatchRequest): UpdateSnapshotInstanceJoinOptionWithBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSnapshotInstanceJoinOptionWithBatchWithOptions(uid, request, headers, runtime);
}

async function updateSnapshotInstanceJoinOptionWithBatchWithOptions(uid: string, request: UpdateSnapshotInstanceJoinOptionWithBatchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotInstanceJoinOptionWithBatchResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.instanceUIDs)) {
    query.instanceUIDs = request.instanceUIDs;
  }

  var body : map[string]any= {};
  if (!Util.isUnset(request.joinSnapshot)) {
    body.joinSnapshot = request.joinSnapshot;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body.rootPassword = request.rootPassword;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateSnapshotInstanceJoinOptionWithBatch', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}

model GetEnvironmentDeploymentRecordResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  data?: {
    envDeploymentInfo?: {
      envUID?: string(name='envUID'),
      status?: string(name='status'),
      uid?: string(name='uid'),
      envParams?: string(name='envParams'),
    }(name='envDeploymentInfo'),
  }(name='data'),
}

model GetEnvironmentDeploymentRecordResponse = {
  headers: map[string]string(name='headers'),
  body: GetEnvironmentDeploymentRecordResponseBody(name='body'),
}

async function getEnvironmentDeploymentRecord(uid: string, deploymentUid: string): GetEnvironmentDeploymentRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentDeploymentRecordWithOptions(uid, deploymentUid, headers, runtime);
}

async function getEnvironmentDeploymentRecordWithOptions(uid: string, deploymentUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentDeploymentRecordResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetEnvironmentDeploymentRecord', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/deployments/${deploymentUid}`, 'json', req, runtime);
}

model GenerateVendorConfigTemplateResponseBody = {
  data?: {
    vendorConfig?: string(name='vendorConfig'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GenerateVendorConfigTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: GenerateVendorConfigTemplateResponseBody(name='body'),
}

async function generateVendorConfigTemplate(uid: string): GenerateVendorConfigTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateVendorConfigTemplateWithOptions(uid, headers, runtime);
}

async function generateVendorConfigTemplateWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateVendorConfigTemplateResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GenerateVendorConfigTemplate', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/vendorConfigTmpl`, 'json', req, runtime);
}

model UpdateProductComponentRequest {
  componentOrchestrationValues?: string(name='componentOrchestrationValues'),
  enable?: boolean(name='enable'),
  releaseName?: string(name='releaseName'),
}

model UpdateProductComponentResponseBody = {
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
}

model UpdateProductComponentResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductComponentResponseBody(name='body'),
}

async function updateProductComponent(uid: string, request: UpdateProductComponentRequest): UpdateProductComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductComponentWithOptions(uid, request, headers, runtime);
}

async function updateProductComponentWithOptions(uid: string, request: UpdateProductComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductComponentResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.componentOrchestrationValues)) {
    body.componentOrchestrationValues = request.componentOrchestrationValues;
  }
  if (!Util.isUnset(request.enable)) {
    body.enable = request.enable;
  }
  if (!Util.isUnset(request.releaseName)) {
    body.releaseName = request.releaseName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateProductComponent', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/productComponentVersions/${uid}`, 'json', req, runtime);
}

model ListProductVersionConfigRequest {
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
  configType?: string(name='configType'),
}

model ListProductVersionConfigResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  data?: {
    list?: [ 
      {
        productVersionUID?: string(name='productVersionUID'),
        componentVersionUID?: string(name='componentVersionUID'),
        name?: string(name='name'),
        value?: string(name='value'),
        description?: string(name='description'),
        parentComponentVersionUID?: string(name='parentComponentVersionUID'),
        componentName?: string(name='componentName'),
        parentComponentName?: string(name='parentComponentName'),
        componentReleaseName?: string(name='componentReleaseName'),
        parentComponentReleaseName?: string(name='parentComponentReleaseName'),
      }
    ](name='list'),
  }(name='data'),
}

model ListProductVersionConfigResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductVersionConfigResponseBody(name='body'),
}

async function listProductVersionConfig(uid: string, request: ListProductVersionConfigRequest): ListProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionConfigWithOptions(uid, request, headers, runtime);
}

async function listProductVersionConfigWithOptions(uid: string, request: ListProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionConfigResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.configType)) {
    query.configType = request.configType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListProductVersionConfig', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/configs`, 'json', req, runtime);
}

model AddAuthorizationHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model AddAuthorizationRequest {
  grantee?: string(name='grantee'),
  resourceType?: string(name='resourceType'),
  resourceIdentifier?: string(name='resourceIdentifier'),
  type?: string(name='type', description='可选值：["ReadOnly","ReadWrite"]'),
  effect?: string(name='effect', description='可选值：["Allow","Deny"]'),
  description?: string(name='description'),
}

model AddAuthorizationResponseBody = {
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
}

model AddAuthorizationResponse = {
  headers: map[string]string(name='headers'),
  body: AddAuthorizationResponseBody(name='body'),
}

async function addAuthorization(request: AddAuthorizationRequest): AddAuthorizationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddAuthorizationHeaders{};
  return addAuthorizationWithOptions(request, headers, runtime);
}

async function addAuthorizationWithOptions(request: AddAuthorizationRequest, headers: AddAuthorizationHeaders, runtime: Util.RuntimeOptions): AddAuthorizationResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.grantee)) {
    body.grantee = request.grantee;
  }
  if (!Util.isUnset(request.resourceType)) {
    body.resourceType = request.resourceType;
  }
  if (!Util.isUnset(request.resourceIdentifier)) {
    body.resourceIdentifier = request.resourceIdentifier;
  }
  if (!Util.isUnset(request.type)) {
    body.type = request.type;
  }
  if (!Util.isUnset(request.effect)) {
    body.effect = request.effect;
  }
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('AddAuthorization', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/authorizations`, 'json', req, runtime);
}

model ListAuthorizedResourcesHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model ListAuthorizedResourcesRequest {
  resourceType?: string(name='resourceType'),
  resourceIdentifier?: string(name='resourceIdentifier'),
  pageNum?: long(name='pageNum'),
  pageSize?: long(name='pageSize'),
  sortKey?: string(name='sortKey'),
  sortDirect?: string(name='sortDirect'),
  filterOptions?: map[string]any(name='filterOptions'),
}

model ListAuthorizedResourcesShrinkRequest {
  resourceType?: string(name='resourceType'),
  resourceIdentifier?: string(name='resourceIdentifier'),
  pageNum?: long(name='pageNum'),
  pageSize?: long(name='pageSize'),
  sortKey?: string(name='sortKey'),
  sortDirect?: string(name='sortDirect'),
  filterOptionsShrink?: string(name='filterOptions'),
}

model ListAuthorizedResourcesResponseBody = {
  data?: {
    total?: long(name='total'),
    pageNum?: long(name='pageNum'),
    pageSize?: long(name='PageSize'),
    list?: [ 
      {
        foo?: string(name='foo'),
      }
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListAuthorizedResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: ListAuthorizedResourcesResponseBody(name='body'),
}

async function listAuthorizedResources(request: ListAuthorizedResourcesRequest): ListAuthorizedResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ListAuthorizedResourcesHeaders{};
  return listAuthorizedResourcesWithOptions(request, headers, runtime);
}

async function listAuthorizedResourcesWithOptions(tmpReq: ListAuthorizedResourcesRequest, headers: ListAuthorizedResourcesHeaders, runtime: Util.RuntimeOptions): ListAuthorizedResourcesResponse {
  Util.validateModel(tmpReq);
  var request = new ListAuthorizedResourcesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.filterOptions)) {
    request.filterOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterOptions, 'filterOptions', 'json');
  }
  var query : map[string]any= {};
  if (!Util.isUnset(request.resourceType)) {
    query.resourceType = request.resourceType;
  }
  if (!Util.isUnset(request.resourceIdentifier)) {
    query.resourceIdentifier = request.resourceIdentifier;
  }
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.sortKey)) {
    query.sortKey = request.sortKey;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query.sortDirect = request.sortDirect;
  }
  if (!Util.isUnset(request.filterOptionsShrink)) {
    query.filterOptions = request.filterOptionsShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListAuthorizedResources', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/authorizations/resources`, 'json', req, runtime);
}

model CreateEnvironmentNodeRequest {
  cpu?: int32(name='cpu'),
  dataDisk?: [ 
    {
      name?: string(name='name'),
      required?: int32(name='required'),
    }
  ](name='dataDisk'),
  hostName?: string(name='hostName'),
  identifier?: string(name='identifier'),
  labels?: map[string]any(name='labels'),
  memory?: int32(name='memory'),
  os?: string(name='os'),
  privateIP?: string(name='privateIP'),
  provider?: string(name='provider'),
  rootPassword?: string(name='rootPassword'),
  systemDisk?: [ 
    {
      name?: string(name='name'),
      required?: int32(name='required'),
    }
  ](name='systemDisk'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
}

model CreateEnvironmentNodeResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateEnvironmentNodeResponse = {
  headers: map[string]string(name='headers'),
  body: CreateEnvironmentNodeResponseBody(name='body'),
}

async function createEnvironmentNode(uid: string, request: CreateEnvironmentNodeRequest): CreateEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEnvironmentNodeWithOptions(uid, request, headers, runtime);
}

async function createEnvironmentNodeWithOptions(uid: string, request: CreateEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentNodeResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.cpu)) {
    body.cpu = request.cpu;
  }
  if (!Util.isUnset(request.dataDisk)) {
    body.dataDisk = request.dataDisk;
  }
  if (!Util.isUnset(request.hostName)) {
    body.hostName = request.hostName;
  }
  if (!Util.isUnset(request.identifier)) {
    body.identifier = request.identifier;
  }
  if (!Util.isUnset(request.labels)) {
    body.labels = request.labels;
  }
  if (!Util.isUnset(request.memory)) {
    body.memory = request.memory;
  }
  if (!Util.isUnset(request.os)) {
    body.os = request.os;
  }
  if (!Util.isUnset(request.privateIP)) {
    body.privateIP = request.privateIP;
  }
  if (!Util.isUnset(request.provider)) {
    body.provider = request.provider;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body.rootPassword = request.rootPassword;
  }
  if (!Util.isUnset(request.systemDisk)) {
    body.systemDisk = request.systemDisk;
  }
  if (!Util.isUnset(request.taints)) {
    body.taints = request.taints;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateEnvironmentNode', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/nodes`, 'json', req, runtime);
}

model ListFoundationVersionRelatedComponentVersionsResponseBody = {
  requestId?: string(name='RequestId'),
  data?: {
    list?: [
      ComponentVersion
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListFoundationVersionRelatedComponentVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListFoundationVersionRelatedComponentVersionsResponseBody(name='body'),
}

async function listFoundationVersionRelatedComponentVersions(uid: string): ListFoundationVersionRelatedComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFoundationVersionRelatedComponentVersionsWithOptions(uid, headers, runtime);
}

async function listFoundationVersionRelatedComponentVersionsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationVersionRelatedComponentVersionsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListFoundationVersionRelatedComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions/${uid}/component_versions`, 'json', req, runtime);
}

model GetSnapshotResponseBody = {
  data?: {
    description?: string(name='description'),
    instanceCIDR?: string(name='instanceCIDR'),
    name?: string(name='name'),
    productName?: string(name='productName'),
    productVersion?: string(name='productVersion'),
    productVersionDesc?: string(name='productVersionDesc'),
    region?: string(name='region'),
    snapshotRegion?: string(name='snapshotRegion'),
    snapshotStatus?: string(name='snapshotStatus'),
    sourceEnvironmentUID?: string(name='sourceEnvironmentUID'),
    sourceType?: string(name='sourceType'),
    uid?: string(name='uid'),
    vpcid?: string(name='vpcid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: GetSnapshotResponseBody(name='body'),
}

async function getSnapshot(uid: string): GetSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSnapshotWithOptions(uid, headers, runtime);
}

async function getSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetSnapshotResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetSnapshot', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}

model DeleteProductVersionResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model DeleteProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteProductVersionResponseBody(name='body'),
}

async function deleteProductVersion(uid: string): DeleteProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductVersionWithOptions(uid, headers, runtime);
}

async function deleteProductVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteProductVersion', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/products/${uid}/versions`, 'json', req, runtime);
}

model CreateLatestProductVersionHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateLatestProductVersionResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateLatestProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: CreateLatestProductVersionResponseBody(name='body'),
}

async function createLatestProductVersion(uid: string, versionUID: string): CreateLatestProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateLatestProductVersionHeaders{};
  return createLatestProductVersionWithOptions(uid, versionUID, headers, runtime);
}

async function createLatestProductVersionWithOptions(uid: string, versionUID: string, headers: CreateLatestProductVersionHeaders, runtime: Util.RuntimeOptions): CreateLatestProductVersionResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  return doROARequest('CreateLatestProductVersion', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products/${uid}/versions/${versionUID}`, 'json', req, runtime);
}

model CreateProductHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateProductRequest {
  annotations?: string(name='annotations'),
  description?: string(name='description'),
  foundationVersionUID?: string(name='foundationVersionUID'),
  productName?: string(name='productName'),
}

model CreateProductResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateProductResponse = {
  headers: map[string]string(name='headers'),
  body: CreateProductResponseBody(name='body'),
}

async function createProduct(request: CreateProductRequest): CreateProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateProductHeaders{};
  return createProductWithOptions(request, headers, runtime);
}

async function createProductWithOptions(request: CreateProductRequest, headers: CreateProductHeaders, runtime: Util.RuntimeOptions): CreateProductResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.annotations)) {
    body.annotations = request.annotations;
  }
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.foundationVersionUID)) {
    body.foundationVersionUID = request.foundationVersionUID;
  }
  if (!Util.isUnset(request.productName)) {
    body.productName = request.productName;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateProduct', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products`, 'json', req, runtime);
}

model GetProductEnvironmentsRequest {
  productUID?: string(name='productUID'),
  envType?: string(name='envType'),
  platforms?: [ 
    {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }
  ](name='platforms'),
}

model GetProductEnvironmentsShrinkRequest {
  productUID?: string(name='productUID'),
  envType?: string(name='envType'),
  platformsShrink?: string(name='platforms'),
}

model GetProductEnvironmentsResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  data?: [ 
    {
      uid?: string(name='uid'),
      productUID?: string(name='productUID'),
      productName?: string(name='productName'),
      productVersion?: string(name='productVersion'),
      productVersionUID?: string(name='productVersionUID'),
      provider?: string(name='provider'),
      envUID?: string(name='envUID'),
      envType?: string(name='envType'),
      envName?: string(name='envName'),
      oldProductVersion?: string(name='oldProductVersion'),
      oldProductVersionUID?: string(name='oldProductVersionUID'),
    }
  ](name='data'),
}

model GetProductEnvironmentsResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductEnvironmentsResponseBody(name='body'),
}

async function getProductEnvironments(request: GetProductEnvironmentsRequest): GetProductEnvironmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductEnvironmentsWithOptions(request, headers, runtime);
}

async function getProductEnvironmentsWithOptions(tmpReq: GetProductEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductEnvironmentsResponse {
  Util.validateModel(tmpReq);
  var request = new GetProductEnvironmentsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  var query : map[string]any= {};
  if (!Util.isUnset(request.productUID)) {
    query.productUID = request.productUID;
  }
  if (!Util.isUnset(request.envType)) {
    query.envType = request.envType;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query.platforms = request.platformsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetProductEnvironments', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_envs`, 'json', req, runtime);
}

model ValidateEnvironmentTunnelRequest {
  tunnelType?: string(name='tunnelType', description='通道类型'),
  tunnelConfig?: {
    hostname?: string(name='hostname', description='跳板机hostname'),
    sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
    username?: string(name='username', description='跳板机用户名'),
    password?: string(name='password', description='跳板机密码'),
    vpcId?: string(name='vpcId', description='直连vpcId'),
    regionId?: string(name='regionId', description='直连地域id'),
  }(name='tunnelConfig', description='通道配置'),
}

model ValidateEnvironmentTunnelResponseBody = {
  errCode?: string(name='errCode', description='错误码'),
  errMsg?: string(name='errMsg', description='错误信息'),
  success?: boolean(name='success', description='是否成功'),
}

model ValidateEnvironmentTunnelResponse = {
  headers: map[string]string(name='headers'),
  body: ValidateEnvironmentTunnelResponseBody(name='body'),
}

async function validateEnvironmentTunnel(uid: string, request: ValidateEnvironmentTunnelRequest): ValidateEnvironmentTunnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return validateEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}

async function validateEnvironmentTunnelWithOptions(uid: string, request: ValidateEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ValidateEnvironmentTunnelResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.tunnelType)) {
    body.tunnelType = request.tunnelType;
  }
  if (!Util.isUnset(request.tunnelConfig)) {
    body.tunnelConfig = request.tunnelConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('ValidateEnvironmentTunnel', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/tunnels/validation`, 'json', req, runtime);
}

model DeleteEnvironmentResponseBody = {
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
}

model DeleteEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteEnvironmentResponseBody(name='body'),
}

async function deleteEnvironment(uid: string): DeleteEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentWithOptions(uid, headers, runtime);
}

async function deleteEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteEnvironment', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}

model CreateSnapshotRequest {
  description?: string(name='description'),
  name?: string(name='name'),
  productName?: string(name='productName'),
  productVersion?: string(name='productVersion'),
  productVersionDesc?: string(name='productVersionDesc'),
  region?: string(name='region'),
  vpcid?: string(name='vpcid'),
}

model CreateSnapshotResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: CreateSnapshotResponseBody(name='body'),
}

async function createSnapshot(request: CreateSnapshotRequest): CreateSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSnapshotWithOptions(request, headers, runtime);
}

async function createSnapshotWithOptions(request: CreateSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSnapshotResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.productName)) {
    body.productName = request.productName;
  }
  if (!Util.isUnset(request.productVersion)) {
    body.productVersion = request.productVersion;
  }
  if (!Util.isUnset(request.productVersionDesc)) {
    body.productVersionDesc = request.productVersionDesc;
  }
  if (!Util.isUnset(request.region)) {
    body.region = request.region;
  }
  if (!Util.isUnset(request.vpcid)) {
    body.vpcid = request.vpcid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots`, 'json', req, runtime);
}

model ListChildrenComponentVersionResponseBody = {
  data?: {
    clusterId?: string(name='clusterId'),
    createdAt?: string(name='createdAt'),
    description?: string(name='description'),
    instanceList?: string(name='instanceList'),
    name?: string(name='name'),
    productName?: string(name='productName'),
    uid?: string(name='uid'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListChildrenComponentVersionResponse = {
  headers: map[string]string(name='headers'),
  body: ListChildrenComponentVersionResponseBody(name='body'),
}

async function listChildrenComponentVersion(id: string, versionId: string, componentId: string): ListChildrenComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listChildrenComponentVersionWithOptions(id, versionId, componentId, headers, runtime);
}

async function listChildrenComponentVersionWithOptions(id: string, versionId: string, componentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListChildrenComponentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListChildrenComponentVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/children/${componentId}`, 'json', req, runtime);
}

model DeleteEnvironmentNodeRequest {
  envUID?: string(name='envUID'),
}

model DeleteEnvironmentNodeResponseBody = {
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='errCode'),
}

model DeleteEnvironmentNodeResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteEnvironmentNodeResponseBody(name='body'),
}

async function deleteEnvironmentNode(uid: string, request: DeleteEnvironmentNodeRequest): DeleteEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentNodeWithOptions(uid, request, headers, runtime);
}

async function deleteEnvironmentNodeWithOptions(uid: string, request: DeleteEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentNodeResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.envUID)) {
    query.envUID = request.envUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('DeleteEnvironmentNode', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}

model GetSnapshotInstancesRequest {
  pageSize?: int32(name='pageSize'),
  pageNum?: int32(name='pageNum'),
  sortKey?: string(name='sortKey'),
  sortDirect?: string(name='sortDirect'),
}

model GetSnapshotInstancesResponseBody = {
  data?: {
    list?: [ 
      {
        annotations?: {
          additionalProp1?: string(name='additionalProp1'),
          additionalProp2?: string(name='additionalProp2'),
          additionalProp3?: string(name='additionalProp3'),
        }(name='annotations'),
        cpu?: int32(name='cpu'),
        ecsInstanceID?: string(name='ecsInstanceID'),
        hostName?: string(name='hostName'),
        identifier?: string(name='identifier'),
        imageID?: string(name='imageID'),
        instanceType?: string(name='instanceType'),
        internetBandwidth?: int32(name='internetBandwidth'),
        joinSnapshot?: boolean(name='joinSnapshot'),
        memory?: int32(name='memory'),
        privateIP?: string(name='privateIP'),
        publicIP?: string(name='publicIP'),
        rootPassword?: string(name='rootPassword'),
        storageTotalSize?: int32(name='storageTotalSize'),
        uid?: string(name='uid'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetSnapshotInstancesResponse = {
  headers: map[string]string(name='headers'),
  body: GetSnapshotInstancesResponseBody(name='body'),
}

async function getSnapshotInstances(uid: string, request: GetSnapshotInstancesRequest): GetSnapshotInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSnapshotInstancesWithOptions(uid, request, headers, runtime);
}

async function getSnapshotInstancesWithOptions(uid: string, request: GetSnapshotInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSnapshotInstancesResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.sortKey)) {
    query.sortKey = request.sortKey;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query.sortDirect = request.sortDirect;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetSnapshotInstances', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}

model CheckSLRRequest {
  uid?: string(name='uid'),
}

model CheckSLRResponseBody = {
  data?: string(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  errorCode?: string(name='errorCode'),
  success?: boolean(name='success'),
}

model CheckSLRResponse = {
  headers: map[string]string(name='headers'),
  body: CheckSLRResponseBody(name='body'),
}

async function checkSLR(request: CheckSLRRequest): CheckSLRResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkSLRWithOptions(request, headers, runtime);
}

async function checkSLRWithOptions(request: CheckSLRRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckSLRResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.uid)) {
    query.uid = request.uid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('CheckSLR', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/slr`, 'json', req, runtime);
}

model ApplyComponentsRequest {
  childrenList?: [ 
    {
      annotations?: string(name='annotations'),
      appVersion?: string(name='appVersion'),
      category?: string(name='category'),
      componentClass?: string(name='componentClass'),
      description?: string(name='description'),
      documents?: string(name='documents'),
      imagesMapping?: string(name='imagesMapping'),
      name?: string(name='name'),
      namespace?: string(name='namespace'),
      orchestrationType?: string(name='orchestrationType'),
      orchestrationValues?: string(name='orchestrationValues'),
      packageURL?: string(name='packageURL'),
      parentComponent?: boolean(name='parentComponent'),
      platforms?: [ 
        {
          architecture?: string(name='architecture'),
          os?: string(name='os'),
        }
      ](name='platforms'),
      priority?: int32(name='priority'),
      provider?: string(name='provider'),
      public?: boolean(name='public'),
      readme?: string(name='readme'),
      resources?: string(name='resources'),
      singleton?: boolean(name='singleton'),
      version?: string(name='version'),
    }
  ](name='childrenList'),
  component?: string(name='component'),
}

model ApplyComponentsResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model ApplyComponentsResponse = {
  headers: map[string]string(name='headers'),
  body: ApplyComponentsResponseBody(name='body'),
}

async function applyComponents(request: ApplyComponentsRequest): ApplyComponentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return applyComponentsWithOptions(request, headers, runtime);
}

async function applyComponentsWithOptions(request: ApplyComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyComponentsResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.childrenList)) {
    body.childrenList = request.childrenList;
  }
  if (!Util.isUnset(request.component)) {
    body.component = request.component;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('ApplyComponents', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/components`, 'json', req, runtime);
}

model CreatePackageConfigResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreatePackageConfigResponse = {
  headers: map[string]string(name='headers'),
  body: CreatePackageConfigResponseBody(name='body'),
}

async function createPackageConfig(uid: string): CreatePackageConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createPackageConfigWithOptions(uid, headers, runtime);
}

async function createPackageConfigWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePackageConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('CreatePackageConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/package_config`, 'json', req, runtime);
}

model AddProductComponentRequest {
  releaseName?: string(name='releaseName'),
}

model AddProductComponentResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model AddProductComponentResponse = {
  headers: map[string]string(name='headers'),
  body: AddProductComponentResponseBody(name='body'),
}

async function addProductComponent(id: string, versionId: string, componentVersionId: string, ClientToken: string, request: AddProductComponentRequest): AddProductComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addProductComponentWithOptions(id, versionId, componentVersionId, ClientToken, request, headers, runtime);
}

async function addProductComponentWithOptions(id: string, versionId: string, componentVersionId: string, ClientToken: string, request: AddProductComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductComponentResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.releaseName)) {
    body.releaseName = request.releaseName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('AddProductComponent', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersions/${componentVersionId}`, 'json', req, runtime);
}

model UpdateProductVersionResourcesRequest {
  resources?: string(name='resources', description='product version resources'),
}

model UpdateProductVersionResourcesResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateProductVersionResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductVersionResourcesResponseBody(name='body'),
}

async function updateProductVersionResources(uid: string, request: UpdateProductVersionResourcesRequest): UpdateProductVersionResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionResourcesWithOptions(uid, request, headers, runtime);
}

async function updateProductVersionResourcesWithOptions(uid: string, request: UpdateProductVersionResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.resources)) {
    query.resources = request.resources;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('UpdateProductVersionResources', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/resource_requirement`, 'json', req, runtime);
}

model DeleteSnapshotResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model DeleteSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteSnapshotResponseBody(name='body'),
}

async function deleteSnapshot(uid: string): DeleteSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSnapshotWithOptions(uid, headers, runtime);
}

async function deleteSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSnapshotResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteSnapshot', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}

model ListEnvironmentsWithSnapshotResponseBody = {
  data?: {
    list?: [ 
      {
        createdAt?: string(name='CreatedAt'),
        description?: string(name='description'),
        id?: int32(name='id'),
        instanceStatus?: string(name='instanceStatus'),
        name?: string(name='name'),
        productName?: string(name='productName'),
        productVersion?: string(name='productVersion'),
        productVersionUID?: string(name='productVersionUID'),
        uid?: string(name='uid'),
        vendorType?: string(name='vendorType'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListEnvironmentsWithSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentsWithSnapshotResponseBody(name='body'),
}

async function listEnvironmentsWithSnapshot(uid: string): ListEnvironmentsWithSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentsWithSnapshotWithOptions(uid, headers, runtime);
}

async function listEnvironmentsWithSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentsWithSnapshotResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListEnvironmentsWithSnapshot', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}/environments`, 'json', req, runtime);
}

model CreateEnvironmentAndGenerateVendorConfigHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateEnvironmentAndGenerateVendorConfigRequest {
  envUID?: string(name='envUID'),
  platform?: {
    architecture?: string(name='architecture'),
    os?: string(name='os'),
  }(name='platform'),
  productName?: string(name='productName'),
  productUID?: string(name='productUID'),
  productVersion?: string(name='productVersion'),
  productVersionUID?: string(name='productVersionUID'),
  vendorType?: string(name='vendorType'),
}

model CreateEnvironmentAndGenerateVendorConfigResponseBody = {
  data?: {
    envUID?: string(name='envUID'),
    vendorConfig?: string(name='vendorConfig'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateEnvironmentAndGenerateVendorConfigResponse = {
  headers: map[string]string(name='headers'),
  body: CreateEnvironmentAndGenerateVendorConfigResponseBody(name='body'),
}

async function createEnvironmentAndGenerateVendorConfig(request: CreateEnvironmentAndGenerateVendorConfigRequest): CreateEnvironmentAndGenerateVendorConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateEnvironmentAndGenerateVendorConfigHeaders{};
  return createEnvironmentAndGenerateVendorConfigWithOptions(request, headers, runtime);
}

async function createEnvironmentAndGenerateVendorConfigWithOptions(request: CreateEnvironmentAndGenerateVendorConfigRequest, headers: CreateEnvironmentAndGenerateVendorConfigHeaders, runtime: Util.RuntimeOptions): CreateEnvironmentAndGenerateVendorConfigResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.envUID)) {
    body.envUID = request.envUID;
  }
  if (!Util.isUnset(request.platform)) {
    body.platform = request.platform;
  }
  if (!Util.isUnset(request.productName)) {
    body.productName = request.productName;
  }
  if (!Util.isUnset(request.productUID)) {
    body.productUID = request.productUID;
  }
  if (!Util.isUnset(request.productVersion)) {
    body.productVersion = request.productVersion;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body.productVersionUID = request.productVersionUID;
  }
  if (!Util.isUnset(request.vendorType)) {
    body.vendorType = request.vendorType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateEnvironmentAndGenerateVendorConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/product_envs/vendor_config`, 'json', req, runtime);
}

model InitSnapshotInstanceResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model InitSnapshotInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: InitSnapshotInstanceResponseBody(name='body'),
}

async function initSnapshotInstance(uid: string): InitSnapshotInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return initSnapshotInstanceWithOptions(uid, headers, runtime);
}

async function initSnapshotInstanceWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): InitSnapshotInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('InitSnapshotInstance', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}

model ListEnvironmentParamsRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  name?: string(name='name'),
  fuzzy?: string(name='fuzzy'),
  paramType?: string(name='paramType', description='组件和全局类型字段'),
  productVersionUID?: string(name='productVersionUID'),
}

model ListEnvironmentParamsResponseBody = {
  data?: {
    list?: [ 
      {
        createdAt?: string(name='createdAt'),
        description?: string(name='description'),
        id?: int32(name='id'),
        name?: string(name='name'),
        productName?: string(name='productName'),
        productVersion?: string(name='productVersion'),
        productVersionUID?: string(name='productVersionUID'),
        uid?: string(name='uid'),
        vendorType?: string(name='vendorType'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListEnvironmentParamsResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentParamsResponseBody(name='body'),
}

async function listEnvironmentParams(uid: string, request: ListEnvironmentParamsRequest): ListEnvironmentParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentParamsWithOptions(uid, request, headers, runtime);
}

async function listEnvironmentParamsWithOptions(uid: string, request: ListEnvironmentParamsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentParamsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.name)) {
    query.name = request.name;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query.fuzzy = request.fuzzy;
  }
  if (!Util.isUnset(request.paramType)) {
    query.paramType = request.paramType;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    query.productVersionUID = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvironmentParams', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/params`, 'json', req, runtime);
}

model GetFoundationVersionResponseBody = {
  data?: [
    FoundationVersion
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetFoundationVersionResponse = {
  headers: map[string]string(name='headers'),
  body: GetFoundationVersionResponseBody(name='body'),
}

async function getFoundationVersion(uid: string): GetFoundationVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFoundationVersionWithOptions(uid, headers, runtime);
}

async function getFoundationVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFoundationVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetFoundationVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions/${uid}`, 'json', req, runtime);
}

model DeleteProductResponseBody = {
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
}

model DeleteProductResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteProductResponseBody(name='body'),
}

async function deleteProduct(uid: string): DeleteProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductWithOptions(uid, headers, runtime);
}

async function deleteProductWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteProduct', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/products/${uid}`, 'json', req, runtime);
}

model GetEnvironmentPackageResponseBody = {
  data?: {
    packageURL?: string(name='packageURL'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetEnvironmentPackageResponse = {
  headers: map[string]string(name='headers'),
  body: GetEnvironmentPackageResponseBody(name='body'),
}

async function getEnvironmentPackage(uid: string): GetEnvironmentPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentPackageWithOptions(uid, headers, runtime);
}

async function getEnvironmentPackageWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentPackageResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetEnvironmentPackage', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/envPackages/${uid}`, 'json', req, runtime);
}

model ListEnvChangeRecordPackageConfigResponseBody = {
  data?: string(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListEnvChangeRecordPackageConfigResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvChangeRecordPackageConfigResponseBody(name='body'),
}

async function listEnvChangeRecordPackageConfig(uid: string, recordUid: string): ListEnvChangeRecordPackageConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvChangeRecordPackageConfigWithOptions(uid, recordUid, headers, runtime);
}

async function listEnvChangeRecordPackageConfigWithOptions(uid: string, recordUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordPackageConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListEnvChangeRecordPackageConfig', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/package_configs`, 'json', req, runtime);
}

model ListComponentsRequest {
  name?: string(name='name'),
  category?: string(name='category'),
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  fuzzy?: string(name='fuzzy'),
  public?: boolean(name='public'),
}

model ListComponentsResponseBody = {
  data?: {
    list?: [ 
      {
        annotations?: {
          annotations?: string(name='annotations'),
        }(name='annotations'),
        category?: string(name='category'),
        description?: string(name='description'),
        documents?: string(name='documents'),
        name?: string(name='name'),
        provider?: string(name='provider'),
        public?: boolean(name='public'),
        singleton?: boolean(name='singleton'),
        source?: string(name='source'),
        uid?: string(name='uid'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListComponentsResponse = {
  headers: map[string]string(name='headers'),
  body: ListComponentsResponseBody(name='body'),
}

async function listComponents(request: ListComponentsRequest): ListComponentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listComponentsWithOptions(request, headers, runtime);
}

async function listComponentsWithOptions(request: ListComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.name)) {
    query.name = request.name;
  }
  if (!Util.isUnset(request.category)) {
    query.category = request.category;
  }
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query.fuzzy = request.fuzzy;
  }
  if (!Util.isUnset(request.public)) {
    query.public = request.public;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListComponents', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components`, 'json', req, runtime);
}

model AddEnvironmentProductVersionHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model AddEnvironmentProductVersionRequest {
  productVersionUID?: string(name='productVersionUID'),
}

model AddEnvironmentProductVersionResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model AddEnvironmentProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: AddEnvironmentProductVersionResponseBody(name='body'),
}

async function addEnvironmentProductVersion(uid: string, request: AddEnvironmentProductVersionRequest): AddEnvironmentProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddEnvironmentProductVersionHeaders{};
  return addEnvironmentProductVersionWithOptions(uid, request, headers, runtime);
}

async function addEnvironmentProductVersionWithOptions(uid: string, request: AddEnvironmentProductVersionRequest, headers: AddEnvironmentProductVersionHeaders, runtime: Util.RuntimeOptions): AddEnvironmentProductVersionResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.productVersionUID)) {
    body.productVersionUID = request.productVersionUID;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('AddEnvironmentProductVersion', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/productVersions`, 'json', req, runtime);
}

model GetChildrenComponentVersionListResponseBody = {
  data?: {
    clusterId?: string(name='clusterId'),
    createdAt?: string(name='createdAt'),
    description?: string(name='description'),
    instanceList?: string(name='instanceList'),
    name?: string(name='name'),
    productName?: string(name='productName'),
    productVersion?: string(name='productVersion'),
    uid?: string(name='uid'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetChildrenComponentVersionListResponse = {
  headers: map[string]string(name='headers'),
  body: GetChildrenComponentVersionListResponseBody(name='body'),
}

async function getChildrenComponentVersionList(id: string, versionId: string): GetChildrenComponentVersionListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getChildrenComponentVersionListWithOptions(id, versionId, headers, runtime);
}

async function getChildrenComponentVersionListWithOptions(id: string, versionId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetChildrenComponentVersionListResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetChildrenComponentVersionList', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/children`, 'json', req, runtime);
}

model CreateSLRHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateSLRResponseBody = {
  data?: string(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  errorCode?: string(name='errorCode'),
  success?: boolean(name='success'),
}

model CreateSLRResponse = {
  headers: map[string]string(name='headers'),
  body: CreateSLRResponseBody(name='body'),
}

async function createSLR(): CreateSLRResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateSLRHeaders{};
  return createSLRWithOptions(headers, runtime);
}

async function createSLRWithOptions(headers: CreateSLRHeaders, runtime: Util.RuntimeOptions): CreateSLRResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  return doROARequest('CreateSLR', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/slr`, 'json', req, runtime);
}

model GetProductVersionRelatedComponentVersionDetailResponseBody = {
  data?: [
    ProductComponentRelationDetail
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionRelatedComponentVersionDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionRelatedComponentVersionDetailResponseBody(name='body'),
}

async function getProductVersionRelatedComponentVersionDetail(uid: string, relationUID: string): GetProductVersionRelatedComponentVersionDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionRelatedComponentVersionDetailWithOptions(uid, relationUID, headers, runtime);
}

async function getProductVersionRelatedComponentVersionDetailWithOptions(uid: string, relationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionRelatedComponentVersionDetailResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersionRelatedComponentVersionDetail', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/relations/${relationUID}`, 'json', req, runtime);
}

model GetProductVersionPlatformsResponseBody = {
  data?: [
    Platform
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionPlatformsResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionPlatformsResponseBody(name='body'),
}

async function getProductVersionPlatforms(uid: string): GetProductVersionPlatformsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionPlatformsWithOptions(uid, headers, runtime);
}

async function getProductVersionPlatformsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPlatformsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersionPlatforms', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/platforms`, 'json', req, runtime);
}

model SetEnvironmentTunnelRequest {
  tunnelType?: string(name='tunnelType', description='通道类型'),
  tunnelConfig?: {
    sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
    hostname?: string(name='hostname', description='跳板机hostname'),
    username?: string(name='username', description='跳板机用户名'),
    password?: string(name='password', description='跳板机密码'),
    vpcId?: string(name='vpcId', description='直连vpcId'),
    regionId?: string(name='regionId', description='直连地域id'),
  }(name='tunnelConfig', description='通道配置'),
}

model SetEnvironmentTunnelResponseBody = {
  errCode?: string(name='errCode', description='错误码'),
  errMsg?: string(name='errMsg', description='错误信息'),
  success?: boolean(name='success', description='是否成功'),
  date?: {
    uid?: string(name='uid', description='通道id，可空'),
  }(name='date', description='数据'),
}

model SetEnvironmentTunnelResponse = {
  headers: map[string]string(name='headers'),
  body: SetEnvironmentTunnelResponseBody(name='body'),
}

async function setEnvironmentTunnel(uid: string, request: SetEnvironmentTunnelRequest): SetEnvironmentTunnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return setEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}

async function setEnvironmentTunnelWithOptions(uid: string, request: SetEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SetEnvironmentTunnelResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.tunnelType)) {
    body.tunnelType = request.tunnelType;
  }
  if (!Util.isUnset(request.tunnelConfig)) {
    body.tunnelConfig = request.tunnelConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('SetEnvironmentTunnel', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/tunnels`, 'json', req, runtime);
}

model GetProductVersionResourceResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionResourceResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionResourceResponseBody(name='body'),
}

async function getProductVersionResource(uid: string): GetProductVersionResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionResourceWithOptions(uid, headers, runtime);
}

async function getProductVersionResourceWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResourceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersionResource', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/resources`, 'json', req, runtime);
}

model ApplyEnvironmentResourceRequest {
  accessKeyID?: string(name='accessKeyID'),
  accessKeySecret?: string(name='accessKeySecret'),
  securityToken?: string(name='securityToken'),
}

model ApplyEnvironmentResourceResponseBody = {
  data?: {
    status?: string(name='status'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ApplyEnvironmentResourceResponse = {
  headers: map[string]string(name='headers'),
  body: ApplyEnvironmentResourceResponseBody(name='body'),
}

async function applyEnvironmentResource(uid: string, request: ApplyEnvironmentResourceRequest): ApplyEnvironmentResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return applyEnvironmentResourceWithOptions(uid, request, headers, runtime);
}

async function applyEnvironmentResourceWithOptions(uid: string, request: ApplyEnvironmentResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyEnvironmentResourceResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.accessKeyID)) {
    body.accessKeyID = request.accessKeyID;
  }
  if (!Util.isUnset(request.accessKeySecret)) {
    body.accessKeySecret = request.accessKeySecret;
  }
  if (!Util.isUnset(request.securityToken)) {
    body.securityToken = request.securityToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('ApplyEnvironmentResource', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/resource`, 'json', req, runtime);
}

model ListEnvChangeRecordsRequest {
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
}

model ListEnvChangeRecordsResponseBody = {
  data?: {
    list?: [ 
      {
        deliveriedProductVersion?: string(name='deliveried_product_version', description='交付产品版本'),
        originProductVersion?: string(name='origin_product_version', description='源版本'),
        deliveriedAt?: string(name='deliveried_at', description='交付时间'),
        foundationVersion?: string(name='foundation_version', description='底座版本'),
        description?: string(name='description', description='交付描述'),
      }
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListEnvChangeRecordsResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvChangeRecordsResponseBody(name='body'),
}

async function listEnvChangeRecords(uid: string, request: ListEnvChangeRecordsRequest): ListEnvChangeRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvChangeRecordsWithOptions(uid, request, headers, runtime);
}

async function listEnvChangeRecordsWithOptions(uid: string, request: ListEnvChangeRecordsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvChangeRecords', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records`, 'json', req, runtime);
}

model AddProductVersionConfigRequest {
  name?: string(name='name', description='配置信息key'),
  value?: string(name='value', description='配置信息value'),
  notes?: string(name='notes', description='配置说明'),
  componentVersionUID?: string(name='componentVersionUID', description='组件uid'),
  parentComponentVersionUID?: string(name='ParentComponentVersionUID', description='父组件uid'),
}

model AddProductVersionConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model AddProductVersionConfigResponse = {
  headers: map[string]string(name='headers'),
  body: AddProductVersionConfigResponseBody(name='body'),
}

async function addProductVersionConfig(uid: string, request: AddProductVersionConfigRequest): AddProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addProductVersionConfigWithOptions(uid, request, headers, runtime);
}

async function addProductVersionConfigWithOptions(uid: string, request: AddProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductVersionConfigResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.value)) {
    body.value = request.value;
  }
  if (!Util.isUnset(request.notes)) {
    body.notes = request.notes;
  }
  if (!Util.isUnset(request.componentVersionUID)) {
    body.componentVersionUID = request.componentVersionUID;
  }
  if (!Util.isUnset(request.parentComponentVersionUID)) {
    body.ParentComponentVersionUID = request.parentComponentVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('AddProductVersionConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}

model ShareSnapshotRequest {
  targetProvider?: string(name='targetProvider'),
}

model ShareSnapshotResponseBody = {
  data?: {
    newSnapshotUID?: string(name='newSnapshotUID'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ShareSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: ShareSnapshotResponseBody(name='body'),
}

async function shareSnapshot(uid: string, request: ShareSnapshotRequest): ShareSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return shareSnapshotWithOptions(uid, request, headers, runtime);
}

async function shareSnapshotWithOptions(uid: string, request: ShareSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ShareSnapshotResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.targetProvider)) {
    body.targetProvider = request.targetProvider;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('ShareSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/snapshots`, 'json', req, runtime);
}

model DeleteEnvironmentParamResponseBody = {
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='errCode'),
}

model DeleteEnvironmentParamResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteEnvironmentParamResponseBody(name='body'),
}

async function deleteEnvironmentParam(uid: string): DeleteEnvironmentParamResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEnvironmentParamWithOptions(uid, headers, runtime);
}

async function deleteEnvironmentParamWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentParamResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteEnvironmentParam', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environmentparams/${uid}`, 'json', req, runtime);
}

model DeleteComponentVersionResponseBody = {
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
}

model DeleteComponentVersionResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteComponentVersionResponseBody(name='body'),
}

async function deleteComponentVersion(uid: string, versionUid: string): DeleteComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteComponentVersionWithOptions(uid, versionUid, headers, runtime);
}

async function deleteComponentVersionWithOptions(uid: string, versionUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteComponentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteComponentVersion', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/components/${uid}/versions/${versionUid}`, 'json', req, runtime);
}

model DeployEnvironmentProductRequest {
  packageUID?: string(name='packageUID', description='部署包uid'),
}

model DeployEnvironmentProductResponseBody = {
  errCode?: string(name='errCode', description='错误码'),
  errMsg?: string(name='errMsg', description='错误信息'),
  success?: boolean(name='success', description='是否成功'),
  data?: {
    uid?: string(name='uid', description='部署uid'),
  }(name='data', description='数据'),
}

model DeployEnvironmentProductResponse = {
  headers: map[string]string(name='headers'),
  body: DeployEnvironmentProductResponseBody(name='body'),
}

async function deployEnvironmentProduct(uid: string, request: DeployEnvironmentProductRequest): DeployEnvironmentProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deployEnvironmentProductWithOptions(uid, request, headers, runtime);
}

async function deployEnvironmentProductWithOptions(uid: string, request: DeployEnvironmentProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeployEnvironmentProductResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.packageUID)) {
    body.packageUID = request.packageUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('DeployEnvironmentProduct', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/deployment`, 'json', req, runtime);
}

model InitEnvironmentResourceRequest {
  accessKeyID?: string(name='accessKeyID'),
  accessKeySecret?: string(name='accessKeySecret'),
  securityToken?: string(name='securityToken'),
}

model InitEnvironmentResourceResponseBody = {
  data?: {
    status?: string(name='status'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model InitEnvironmentResourceResponse = {
  headers: map[string]string(name='headers'),
  body: InitEnvironmentResourceResponseBody(name='body'),
}

async function initEnvironmentResource(uid: string, request: InitEnvironmentResourceRequest): InitEnvironmentResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return initEnvironmentResourceWithOptions(uid, request, headers, runtime);
}

async function initEnvironmentResourceWithOptions(uid: string, request: InitEnvironmentResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): InitEnvironmentResourceResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.accessKeyID)) {
    body.accessKeyID = request.accessKeyID;
  }
  if (!Util.isUnset(request.accessKeySecret)) {
    body.accessKeySecret = request.accessKeySecret;
  }
  if (!Util.isUnset(request.securityToken)) {
    body.securityToken = request.securityToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('InitEnvironmentResource', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/resources`, 'json', req, runtime);
}

model ListEnvironmentDeployRecordRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
}

model ListEnvironmentDeployRecordResponseBody = {
  data?: {
    list?: [ 
      {
        envUID?: string(name='envUID'),
        provider?: string(name='provider'),
        status?: string(name='status'),
        uid?: string(name='uid'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListEnvironmentDeployRecordResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentDeployRecordResponseBody(name='body'),
}

async function listEnvironmentDeployRecord(uid: string, request: ListEnvironmentDeployRecordRequest): ListEnvironmentDeployRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentDeployRecordWithOptions(uid, request, headers, runtime);
}

async function listEnvironmentDeployRecordWithOptions(uid: string, request: ListEnvironmentDeployRecordRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentDeployRecordResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvironmentDeployRecord', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/deployments`, 'json', req, runtime);
}

model ListProductVersionRelatedComponentVersionsRequest {
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
  sortKey?: string(name='sortKey'),
  sortDirect?: string(name='sortDirect'),
  category?: string(name='category'),
}

model ListProductVersionRelatedComponentVersionsResponseBody = {
  data?: {
    list?: [
      ProductComponentRelationDetail
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListProductVersionRelatedComponentVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductVersionRelatedComponentVersionsResponseBody(name='body'),
}

async function listProductVersionRelatedComponentVersions(uid: string, request: ListProductVersionRelatedComponentVersionsRequest): ListProductVersionRelatedComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionRelatedComponentVersionsWithOptions(uid, request, headers, runtime);
}

async function listProductVersionRelatedComponentVersionsWithOptions(uid: string, request: ListProductVersionRelatedComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionRelatedComponentVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.sortKey)) {
    query.sortKey = request.sortKey;
  }
  if (!Util.isUnset(request.sortDirect)) {
    query.sortDirect = request.sortDirect;
  }
  if (!Util.isUnset(request.category)) {
    query.category = request.category;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListProductVersionRelatedComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/component_versions`, 'json', req, runtime);
}

model GetComponentVersionChildrenResponseBody = {
  data?: [ 
    {
      componentName?: string(name='componentName'),
      componentUID?: string(name='componentUID'),
      description?: string(name='description'),
      documents?: [ string ](name='documents'),
      orchestrationValues?: string(name='orchestrationValues'),
      packageURL?: string(name='packageURL'),
      parentComponent?: boolean(name='parentComponent'),
      productComponentVersionUID?: string(name='productComponentVersionUID'),
      provider?: string(name='provider'),
      readme?: string(name='readme'),
      resources?: string(name='resources'),
      uid?: string(name='uid'),
      version?: string(name='version'),
    }
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model GetComponentVersionChildrenResponse = {
  headers: map[string]string(name='headers'),
  body: GetComponentVersionChildrenResponseBody(name='body'),
}

async function getComponentVersionChildren(uid: string, versionUID: string): GetComponentVersionChildrenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getComponentVersionChildrenWithOptions(uid, versionUID, headers, runtime);
}

async function getComponentVersionChildrenWithOptions(uid: string, versionUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentVersionChildrenResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetComponentVersionChildren', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/components/${uid}/versions/${versionUID}/children`, 'json', req, runtime);
}

model GetProductVersionPackageURLRequest {
  envPackageUID?: string(name='envPackageUID'),
}

model GetProductVersionPackageURLResponseBody = {
  data?: {
    packageURL?: string(name='packageURL'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionPackageURLResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionPackageURLResponseBody(name='body'),
}

async function getProductVersionPackageURL(uid: string, request: GetProductVersionPackageURLRequest): GetProductVersionPackageURLResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionPackageURLWithOptions(uid, request, headers, runtime);
}

async function getProductVersionPackageURLWithOptions(uid: string, request: GetProductVersionPackageURLRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPackageURLResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.envPackageUID)) {
    query.envPackageUID = request.envPackageUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetProductVersionPackageURL', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/packages/url`, 'json', req, runtime);
}

model GetProductVersionRelatedComponentVersionResponseBody = {
  data?: [ 
    {
      relationUID?: string(name='relationUID'),
      productVersionUID?: string(name='productVersionUID'),
      parentComponentVersionUID?: string(name='parentComponentVersionUID'),
      parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID'),
      orchestrationValues?: string(name='orchestrationValues'),
      values?: string(name='values'),
      componentVersionPackageURL?: string(name='componentVersionPackageURL'),
      releaseName?: string(name='releaseName'),
      priority?: int32(name='priority'),
      sequence?: int32(name='sequence'),
      componentVersionUID?: string(name='componentVersionUID'),
      componentUID?: string(name='componentUID'),
      componentName?: string(name='componentName'),
      componentDescription?: string(name='componentDescription'),
      version?: string(name='version'),
      appVersion?: string(name='appVersion'),
      componentVersionDescription?: string(name='componentVersionDescription'),
      parentComponent?: boolean(name='parentComponent'),
      resources?: string(name='resources'),
      namespace?: string(name='namespace'),
    }
  ](name='data'),
}

model GetProductVersionRelatedComponentVersionResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionRelatedComponentVersionResponseBody(name='body'),
}

async function getProductVersionRelatedComponentVersion(relationUID: string): GetProductVersionRelatedComponentVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionRelatedComponentVersionWithOptions(relationUID, headers, runtime);
}

async function getProductVersionRelatedComponentVersionWithOptions(relationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionRelatedComponentVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersionRelatedComponentVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/product_version_relations/${relationUID}`, 'json', req, runtime);
}

model ListAlicloudRegionResponseBody = {
  data?: {
    regions?: {
      region?: [ 
        {
          localName?: string(name='LocalName'),
          regionEndpoint?: string(name='RegionEndpoint'),
          regionId?: string(name='RegionId'),
          status?: string(name='Status'),
        }
      ](name='Region'),
    }(name='Regions'),
    requestId?: string(name='RequestId'),
  }(name='data'),
  success?: boolean(name='success'),
}

model ListAlicloudRegionResponse = {
  headers: map[string]string(name='headers'),
  body: ListAlicloudRegionResponseBody(name='body'),
}

async function listAlicloudRegion(): ListAlicloudRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAlicloudRegionWithOptions(headers, runtime);
}

async function listAlicloudRegionWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListAlicloudRegionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListAlicloudRegion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/alicloud/regions`, 'json', req, runtime);
}

model ListComponentVersionsRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  platforms?: [ 
    {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }
  ](name='platforms'),
}

model ListComponentVersionsShrinkRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  platformsShrink?: string(name='platforms'),
}

model ListComponentVersionsResponseBody = {
  requestId?: string(name='RequestId'),
  data?: {
    list?: [ 
      {
        appVersion?: string(name='appVersion'),
        componentName?: string(name='componentName'),
        componentUID?: string(name='componentUID'),
        description?: string(name='description'),
        documents?: string(name='documents'),
        imagesMapping?: string(name='imagesMapping'),
        orchestrationValues?: string(name='orchestrationValues'),
        packageURL?: string(name='packageURL'),
        parentComponent?: boolean(name='parentComponent'),
        provider?: string(name='provider'),
        readme?: string(name='readme'),
        resources?: string(name='resources'),
        uid?: string(name='uid'),
        version?: string(name='version'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListComponentVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListComponentVersionsResponseBody(name='body'),
}

async function listComponentVersions(uid: string, request: ListComponentVersionsRequest): ListComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listComponentVersionsWithOptions(uid, request, headers, runtime);
}

async function listComponentVersionsWithOptions(uid: string, tmpReq: ListComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentVersionsResponse {
  Util.validateModel(tmpReq);
  var request = new ListComponentVersionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query.platforms = request.platformsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components/${uid}/versions`, 'json', req, runtime);
}

model UpdateEnvironmentNodesRequest {
  envUID?: string(name='envUID'),
  labels?: map[string]any(name='labels'),
  rootPassword?: string(name='rootPassword'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
  etcdDisk?: string(name='etcdDisk', description='etcd数据盘'),
  tridentSystemDisk?: string(name='tridentSystemDisk', description='k8s管控数据盘'),
  tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', description='k8s管控数据盘大小'),
  applicationDisk?: string(name='applicationDisk', description='保留业务分区'),
}

model UpdateEnvironmentNodesResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateEnvironmentNodesResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateEnvironmentNodesResponseBody(name='body'),
}

async function updateEnvironmentNodes(uid: string, request: UpdateEnvironmentNodesRequest): UpdateEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

async function updateEnvironmentNodesWithOptions(uid: string, request: UpdateEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentNodesResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.envUID)) {
    body.envUID = request.envUID;
  }
  if (!Util.isUnset(request.labels)) {
    body.labels = request.labels;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body.rootPassword = request.rootPassword;
  }
  if (!Util.isUnset(request.taints)) {
    body.taints = request.taints;
  }
  if (!Util.isUnset(request.etcdDisk)) {
    body.etcdDisk = request.etcdDisk;
  }
  if (!Util.isUnset(request.tridentSystemDisk)) {
    body.tridentSystemDisk = request.tridentSystemDisk;
  }
  if (!Util.isUnset(request.tridentSystemSizeDisk)) {
    body.tridentSystemSizeDisk = request.tridentSystemSizeDisk;
  }
  if (!Util.isUnset(request.applicationDisk)) {
    body.applicationDisk = request.applicationDisk;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateEnvironmentNodes', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}

model DeleteAuthorizationHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model DeleteAuthorizationResponseBody = {
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model DeleteAuthorizationResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteAuthorizationResponseBody(name='body'),
}

async function deleteAuthorization(uid: string): DeleteAuthorizationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new DeleteAuthorizationHeaders{};
  return deleteAuthorizationWithOptions(uid, headers, runtime);
}

async function deleteAuthorizationWithOptions(uid: string, headers: DeleteAuthorizationHeaders, runtime: Util.RuntimeOptions): DeleteAuthorizationResponse {
  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
  };
  return doROARequest('DeleteAuthorization', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/authorizations/${uid}`, 'json', req, runtime);
}

model CreateEnvironmentHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model CreateEnvironmentRequest {
  annotations?: string(name='annotations'),
  description?: string(name='description'),
  location?: string(name='location'),
  name?: string(name='name'),
  platform?: {
    architecture?: string(name='architecture'),
    os?: string(name='os'),
  }(name='platform'),
  vendorType?: string(name='vendorType'),
  productVersionUID?: string(name='productVersionUID'),
}

model CreateEnvironmentResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: CreateEnvironmentResponseBody(name='body'),
}

async function createEnvironment(request: CreateEnvironmentRequest): CreateEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CreateEnvironmentHeaders{};
  return createEnvironmentWithOptions(request, headers, runtime);
}

async function createEnvironmentWithOptions(request: CreateEnvironmentRequest, headers: CreateEnvironmentHeaders, runtime: Util.RuntimeOptions): CreateEnvironmentResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.annotations)) {
    body.annotations = request.annotations;
  }
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.location)) {
    body.location = request.location;
  }
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.platform)) {
    body.platform = request.platform;
  }
  if (!Util.isUnset(request.vendorType)) {
    body.vendorType = request.vendorType;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body.productVersionUID = request.productVersionUID;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateEnvironment', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments`, 'json', req, runtime);
}

model GetWorkflowStatusRequest {
  workflowType?: string(name='workflowType', description='ENUM:["CreateCluster","DeleteCluster","Pack","Deploy"]'),
}

model GetWorkflowStatusResponseBody = {
  data?: {
    status?: string(name='status'),
    stepStatus?: {
      name?: string(name='name', description='step name'),
      status?: string(name='status', description='step status'),
      workflowTasks?: [ 
        {
          name?: string(name='name', description='task name'),
          status?: string(name='status', description='task status'),
        }
      ](name='workflowTasks'),
    }(name='stepStatus'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetWorkflowStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetWorkflowStatusResponseBody(name='body'),
}

async function getWorkflowStatus(xuid: string, request: GetWorkflowStatusRequest): GetWorkflowStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWorkflowStatusWithOptions(xuid, request, headers, runtime);
}

async function getWorkflowStatusWithOptions(xuid: string, request: GetWorkflowStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkflowStatusResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.workflowType)) {
    query.workflowType = request.workflowType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetWorkflowStatus', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/workflows/${xuid}/status`, 'json', req, runtime);
}

model GetEnvironmentLogRequest {
  workflowType?: string(name='workflowType', description='ENUM:["CreateCluster","DeleteCluster","Pack","Deploy"]'),
  stepName?: string(name='stepName', description='任务 step 的名称'),
  taskName?: string(name='taskName', description='任务 task 的名称'),
}

model GetEnvironmentLogResponseBody = {
  data?: {
    end?: boolean(name='end', description='end 为true，代表日志停止更新'),
    oldMessage?: string(name='oldMessage', description='deprecated。兼容历史日志数据'),
    message?: string(name='message', description='日志数据'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetEnvironmentLogResponse = {
  headers: map[string]string(name='headers'),
  body: GetEnvironmentLogResponseBody(name='body'),
}

async function getEnvironmentLog(uid: string, request: GetEnvironmentLogRequest): GetEnvironmentLogResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentLogWithOptions(uid, request, headers, runtime);
}

async function getEnvironmentLogWithOptions(uid: string, request: GetEnvironmentLogRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentLogResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.workflowType)) {
    query.workflowType = request.workflowType;
  }
  if (!Util.isUnset(request.stepName)) {
    query.stepName = request.stepName;
  }
  if (!Util.isUnset(request.taskName)) {
    query.taskName = request.taskName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetEnvironmentLog', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/envLogs/${uid}`, 'json', req, runtime);
}

model ListEnvironmentNodeRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  name?: string(name='name'),
  fuzzy?: string(name='fuzzy'),
  nodeIp?: string(name='nodeIp'),
}

model ListEnvironmentNodeResponseBody = {
  data?: {
    list?: [
      InstanceInfo
    ](name='list'),
    pageNum?: long(name='pageNum'),
    pageSize?: long(name='pageSize'),
    total?: long(name='total'),
  }(name='data'),
  success?: boolean(name='success'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListEnvironmentNodeResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentNodeResponseBody(name='body'),
}

async function listEnvironmentNode(uid: string, request: ListEnvironmentNodeRequest): ListEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentNodeWithOptions(uid, request, headers, runtime);
}

async function listEnvironmentNodeWithOptions(uid: string, request: ListEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentNodeResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.name)) {
    query.name = request.name;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query.fuzzy = request.fuzzy;
  }
  if (!Util.isUnset(request.nodeIp)) {
    query.nodeIp = request.nodeIp;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvironmentNode', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/nodes`, 'json', req, runtime);
}

model ListProductVersionRelatedFoundationComponentVersionsRequest {
  onlyEnabled?: boolean(name='onlyEnabled'),
}

model ListProductVersionRelatedFoundationComponentVersionsResponseBody = {
  data?: [
    ProductComponentRelationDetail
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListProductVersionRelatedFoundationComponentVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductVersionRelatedFoundationComponentVersionsResponseBody(name='body'),
}

async function listProductVersionRelatedFoundationComponentVersions(uid: string, request: ListProductVersionRelatedFoundationComponentVersionsRequest): ListProductVersionRelatedFoundationComponentVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionRelatedFoundationComponentVersionsWithOptions(uid, request, headers, runtime);
}

async function listProductVersionRelatedFoundationComponentVersionsWithOptions(uid: string, request: ListProductVersionRelatedFoundationComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionRelatedFoundationComponentVersionsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.onlyEnabled)) {
    query.onlyEnabled = request.onlyEnabled;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListProductVersionRelatedFoundationComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/foundation/component_versions`, 'json', req, runtime);
}

model SyncComponentRequest {
  region?: string(name='region'),
  bucketName?: string(name='bucketName'),
}

model SyncComponentResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model SyncComponentResponse = {
  headers: map[string]string(name='headers'),
  body: SyncComponentResponseBody(name='body'),
}

async function syncComponent(request: SyncComponentRequest): SyncComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return syncComponentWithOptions(request, headers, runtime);
}

async function syncComponentWithOptions(request: SyncComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SyncComponentResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.region)) {
    query.region = request.region;
  }
  if (!Util.isUnset(request.bucketName)) {
    query.bucketName = request.bucketName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('SyncComponent', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/oss/sync/apps`, 'json', req, runtime);
}

model UpdateComponentToProductRequest {
  componentVersionID?: string(name='componentVersionID', description='the component Version ID'),
}

model UpdateComponentToProductResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model UpdateComponentToProductResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateComponentToProductResponseBody(name='body'),
}

async function updateComponentToProduct(id: string, versionId: string, productComponentVersionRelationId: string, request: UpdateComponentToProductRequest): UpdateComponentToProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateComponentToProductWithOptions(id, versionId, productComponentVersionRelationId, request, headers, runtime);
}

async function updateComponentToProductWithOptions(id: string, versionId: string, productComponentVersionRelationId: string, request: UpdateComponentToProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateComponentToProductResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.componentVersionID)) {
    query.componentVersionID = request.componentVersionID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('UpdateComponentToProduct', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersionRelations/${productComponentVersionRelationId}`, 'json', req, runtime);
}

model GetComponentResponseBody = {
  data?: {
    annotations?: {
      additionalProp1?: string(name='additionalProp1'),
      additionalProp2?: string(name='additionalProp2'),
      additionalProp3?: string(name='additionalProp3'),
    }(name='annotations'),
    category?: string(name='category'),
    description?: string(name='description'),
    documents?: string(name='documents'),
    name?: string(name='name'),
    provider?: string(name='provider'),
    public?: boolean(name='public'),
    singleton?: boolean(name='singleton'),
    source?: string(name='source'),
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetComponentResponse = {
  headers: map[string]string(name='headers'),
  body: GetComponentResponseBody(name='body'),
}

async function getComponent(uid: string): GetComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getComponentWithOptions(uid, headers, runtime);
}

async function getComponentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetComponent', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components/${uid}`, 'json', req, runtime);
}

model GetLicenseResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model GetLicenseResponse = {
  headers: map[string]string(name='headers'),
  body: GetLicenseResponseBody(name='body'),
}

async function getLicense(uid: string): GetLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLicenseWithOptions(uid, headers, runtime);
}

async function getLicenseWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetLicenseResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetLicense', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/licenses`, 'json', req, runtime);
}

model ListAlicloudVPCResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber'),
    pageSize?: int32(name='PageSize'),
    requestId?: string(name='RequestId'),
    totalCount?: int32(name='TotalCount'),
    vpcs?: {
      vpc?: [ 
        {
          cidrBlock?: string(name='CidrBlock'),
          creationTime?: string(name='CreationTime'),
          description?: string(name='Description'),
          isDefault?: boolean(name='IsDefault'),
          regionId?: string(name='RegionId'),
          status?: string(name='Status'),
          userCidrs?: {
            userCidr?: string(name='UserCidr'),
          }(name='UserCidrs'),
          VRouterId?: string(name='VRouterId'),
          vSwitchIds?: {
            vSwitchId?: [ string ](name='VSwitchId'),
          }(name='VSwitchIds'),
          vpcId?: string(name='VpcId'),
          vpcName?: string(name='VpcName'),
        }
      ](name='Vpc'),
    }(name='Vpcs'),
  }(name='data'),
  success?: boolean(name='success'),
}

model ListAlicloudVPCResponse = {
  headers: map[string]string(name='headers'),
  body: ListAlicloudVPCResponseBody(name='body'),
}

async function listAlicloudVPC(regionid: string): ListAlicloudVPCResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAlicloudVPCWithOptions(regionid, headers, runtime);
}

async function listAlicloudVPCWithOptions(regionid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListAlicloudVPCResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListAlicloudVPC', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/alicloud/regions/${regionid}/vpcs`, 'json', req, runtime);
}

model AddEnvironmentNodesRequest {
  labels?: map[string]any(name='labels'),
  masterPrivateIPs?: [ string ](name='masterPrivateIPs', description='master privateId'),
  rootPassword?: string(name='rootPassword'),
  taints?: [ 
    {
      effect?: string(name='effect'),
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='taints'),
  workerPrivateIPs?: [ string ](name='workerPrivateIPs', description='work privateIp'),
  etcdDisk?: string(name='etcdDisk', description='etcd数据盘'),
  tridentSystemDisk?: string(name='tridentSystemDisk', description='k8s管控数据盘'),
  tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', description='k8s管控数据盘大小'),
  applicationDisk?: string(name='applicationDisk', description='保留业务分区'),
}

model AddEnvironmentNodesResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model AddEnvironmentNodesResponse = {
  headers: map[string]string(name='headers'),
  body: AddEnvironmentNodesResponseBody(name='body'),
}

async function addEnvironmentNodes(uid: string, request: AddEnvironmentNodesRequest): AddEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

async function addEnvironmentNodesWithOptions(uid: string, request: AddEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddEnvironmentNodesResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.labels)) {
    body.labels = request.labels;
  }
  if (!Util.isUnset(request.masterPrivateIPs)) {
    body.masterPrivateIPs = request.masterPrivateIPs;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body.rootPassword = request.rootPassword;
  }
  if (!Util.isUnset(request.taints)) {
    body.taints = request.taints;
  }
  if (!Util.isUnset(request.workerPrivateIPs)) {
    body.workerPrivateIPs = request.workerPrivateIPs;
  }
  if (!Util.isUnset(request.etcdDisk)) {
    body.etcdDisk = request.etcdDisk;
  }
  if (!Util.isUnset(request.tridentSystemDisk)) {
    body.tridentSystemDisk = request.tridentSystemDisk;
  }
  if (!Util.isUnset(request.tridentSystemSizeDisk)) {
    body.tridentSystemSizeDisk = request.tridentSystemSizeDisk;
  }
  if (!Util.isUnset(request.applicationDisk)) {
    body.applicationDisk = request.applicationDisk;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('AddEnvironmentNodes', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/batch_nodes`, 'json', req, runtime);
}

model DeleteComponentResponseBody = {
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='errCode'),
}

model DeleteComponentResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteComponentResponseBody(name='body'),
}

async function deleteComponent(uid: string): DeleteComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteComponentWithOptions(uid, headers, runtime);
}

async function deleteComponentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteComponentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteComponent', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/components/${uid}`, 'json', req, runtime);
}

model DeleteProductComponentResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model DeleteProductComponentResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteProductComponentResponseBody(name='body'),
}

async function deleteProductComponent(id: string, versionId: string, productComponentVersionRelationId: string): DeleteProductComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductComponentWithOptions(id, versionId, productComponentVersionRelationId, headers, runtime);
}

async function deleteProductComponentWithOptions(id: string, versionId: string, productComponentVersionRelationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductComponentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteProductComponent', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersionRelations/${productComponentVersionRelationId}`, 'json', req, runtime);
}

model CreateEnvironmentWithSnapshotRequest {
  environmentDesc?: string(name='environmentDesc'),
  environmentName?: string(name='environmentName'),
}

model CreateEnvironmentWithSnapshotResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateEnvironmentWithSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: CreateEnvironmentWithSnapshotResponseBody(name='body'),
}

async function createEnvironmentWithSnapshot(uid: string, request: CreateEnvironmentWithSnapshotRequest): CreateEnvironmentWithSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEnvironmentWithSnapshotWithOptions(uid, request, headers, runtime);
}

async function createEnvironmentWithSnapshotWithOptions(uid: string, request: CreateEnvironmentWithSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentWithSnapshotResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.environmentDesc)) {
    body.environmentDesc = request.environmentDesc;
  }
  if (!Util.isUnset(request.environmentName)) {
    body.environmentName = request.environmentName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateEnvironmentWithSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/environments`, 'json', req, runtime);
}

model ListEnvChangeRecordNodesRequest {
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
}

model ListEnvChangeRecordNodesResponseBody = {
  data?: {
    list?: [ 
      {
        privateIP?: string(name='privateIP', description='节点'),
        identifier?: string(name='identifier', description='节点类型'),
        cpu?: string(name='cpu', description='cpu'),
        memory?: string(name='memory', description='内存'),
        name?: string(name='name', description='系统盘起始'),
        capacity?: string(name='capacity', description='系统盘结束'),
        label?: map[string]any(name='label', description='标签'),
        taints?: map[string]any(name='taints', description='污点'),
      }
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListEnvChangeRecordNodesResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvChangeRecordNodesResponseBody(name='body'),
}

async function listEnvChangeRecordNodes(uid: string, recordUid: string, request: ListEnvChangeRecordNodesRequest): ListEnvChangeRecordNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvChangeRecordNodesWithOptions(uid, recordUid, request, headers, runtime);
}

async function listEnvChangeRecordNodesWithOptions(uid: string, recordUid: string, request: ListEnvChangeRecordNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordNodesResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvChangeRecordNodes', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/nodes`, 'json', req, runtime);
}

model UpdateProductVersionRequest {
  compatibleVersions?: string(name='compatibleVersions'),
  description?: string(name='description'),
  version?: string(name='version'),
}

model UpdateProductVersionResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductVersionResponseBody(name='body'),
}

async function updateProductVersion(uid: string, request: UpdateProductVersionRequest): UpdateProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionWithOptions(uid, request, headers, runtime);
}

async function updateProductVersionWithOptions(uid: string, request: UpdateProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.compatibleVersions)) {
    body.compatibleVersions = request.compatibleVersions;
  }
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.version)) {
    body.version = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateProductVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}`, 'json', req, runtime);
}

model GetChildrenComponentVersionParametersListRequest {
  relationId?: string(name='relation_id'),
}

model GetChildrenComponentVersionParametersListResponseBody = {
  data?: {
    annotations?: {
      additionalProp1?: string(name='additionalProp1'),
      additionalProp2?: string(name='additionalProp2'),
      additionalProp3?: string(name='additionalProp3'),
    }(name='annotations'),
    category?: string(name='category'),
    class?: string(name='class'),
    description?: string(name='description'),
    documents?: [ string ](name='documents'),
    name?: string(name='name'),
    provider?: string(name='provider'),
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetChildrenComponentVersionParametersListResponse = {
  headers: map[string]string(name='headers'),
  body: GetChildrenComponentVersionParametersListResponseBody(name='body'),
}

async function getChildrenComponentVersionParametersList(id: string, versionId: string, request: GetChildrenComponentVersionParametersListRequest): GetChildrenComponentVersionParametersListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getChildrenComponentVersionParametersListWithOptions(id, versionId, request, headers, runtime);
}

async function getChildrenComponentVersionParametersListWithOptions(id: string, versionId: string, request: GetChildrenComponentVersionParametersListRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetChildrenComponentVersionParametersListResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.relationId)) {
    query.relation_id = request.relationId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetChildrenComponentVersionParametersList', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/components/${id}/versions/${versionId}/parameters`, 'json', req, runtime);
}

model GetLatestVersionDifferencesRequest {
  preVersionID?: string(name='preVersionID', description='上一个产品版本id'),
}

model GetLatestVersionDifferencesResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
  data?: [ 
    {
      componentName?: string(name='componentName', description='组件名称'),
      releaseName?: string(name='releaseName', description='组件实例名称'),
      version?: string(name='version', description='组件当前的版本号'),
      preVersion?: string(name='preVersion', description='组件之前的版本号'),
      difference?: string(name='difference', description='变更类型，ENUM 类型'),
      upgradeFlag?: boolean(name='upgradeFlag'),
      message?: string(name='message', description='变更描述信息'),
    }
  ](name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetLatestVersionDifferencesResponse = {
  headers: map[string]string(name='headers'),
  body: GetLatestVersionDifferencesResponseBody(name='body'),
}

async function getLatestVersionDifferences(id: string, versionID: string, request: GetLatestVersionDifferencesRequest): GetLatestVersionDifferencesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLatestVersionDifferencesWithOptions(id, versionID, request, headers, runtime);
}

async function getLatestVersionDifferencesWithOptions(id: string, versionID: string, request: GetLatestVersionDifferencesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetLatestVersionDifferencesResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.preVersionID)) {
    query.preVersionID = request.preVersionID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('GetLatestVersionDifferences', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionID}/differences`, 'json', req, runtime);
}

model ApplyComponentRequest {
  annotations?: string(name='annotations'),
  appVersion?: string(name='appVersion'),
  category?: string(name='category'),
  componentClass?: string(name='componentClass'),
  description?: string(name='description'),
  documents?: string(name='documents'),
  imagesMapping?: string(name='imagesMapping'),
  name?: string(name='name'),
  namespace?: string(name='namespace'),
  orchestrationType?: string(name='orchestrationType'),
  orchestrationValues?: string(name='orchestrationValues'),
  packageURL?: string(name='packageURL'),
  parentComponent?: boolean(name='parentComponent'),
  platforms?: [ 
    {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }
  ](name='platforms'),
  priority?: int32(name='priority'),
  provider?: string(name='provider'),
  public?: boolean(name='public'),
  readme?: string(name='readme'),
  resources?: string(name='resources'),
  singleton?: boolean(name='singleton'),
  version?: string(name='version'),
}

model ApplyComponentResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  status?: string(name='status'),
  success?: boolean(name='success'),
}

model ApplyComponentResponse = {
  headers: map[string]string(name='headers'),
  body: ApplyComponentResponseBody(name='body'),
}

async function applyComponent(request: ApplyComponentRequest): ApplyComponentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return applyComponentWithOptions(request, headers, runtime);
}

async function applyComponentWithOptions(request: ApplyComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyComponentResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.annotations)) {
    body.annotations = request.annotations;
  }
  if (!Util.isUnset(request.appVersion)) {
    body.appVersion = request.appVersion;
  }
  if (!Util.isUnset(request.category)) {
    body.category = request.category;
  }
  if (!Util.isUnset(request.componentClass)) {
    body.componentClass = request.componentClass;
  }
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.documents)) {
    body.documents = request.documents;
  }
  if (!Util.isUnset(request.imagesMapping)) {
    body.imagesMapping = request.imagesMapping;
  }
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    body.namespace = request.namespace;
  }
  if (!Util.isUnset(request.orchestrationType)) {
    body.orchestrationType = request.orchestrationType;
  }
  if (!Util.isUnset(request.orchestrationValues)) {
    body.orchestrationValues = request.orchestrationValues;
  }
  if (!Util.isUnset(request.packageURL)) {
    body.packageURL = request.packageURL;
  }
  if (!Util.isUnset(request.parentComponent)) {
    body.parentComponent = request.parentComponent;
  }
  if (!Util.isUnset(request.platforms)) {
    body.platforms = request.platforms;
  }
  if (!Util.isUnset(request.priority)) {
    body.priority = request.priority;
  }
  if (!Util.isUnset(request.provider)) {
    body.provider = request.provider;
  }
  if (!Util.isUnset(request.public)) {
    body.public = request.public;
  }
  if (!Util.isUnset(request.readme)) {
    body.readme = request.readme;
  }
  if (!Util.isUnset(request.resources)) {
    body.resources = request.resources;
  }
  if (!Util.isUnset(request.singleton)) {
    body.singleton = request.singleton;
  }
  if (!Util.isUnset(request.version)) {
    body.version = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('ApplyComponent', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/apps`, 'json', req, runtime);
}

model GetProductVersionResourcesResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model GetProductVersionResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionResourcesResponseBody(name='body'),
}

async function getProductVersionResources(uid: string): GetProductVersionResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionResourcesWithOptions(uid, headers, runtime);
}

async function getProductVersionResourcesWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResourcesResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersionResources', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/resource_requirement`, 'json', req, runtime);
}

model ListEnvironmentsRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  name?: string(name='name'),
  fuzzy?: string(name='fuzzy'),
  instanceStatus?: string(name='instanceStatus'),
  vendorType?: string(name='vendorType'),
}

model ListEnvironmentsResponseBody = {
  data?: {
    list?: [ 
      {
        createdAt?: string(name='createdAt'),
        description?: string(name='description'),
        id?: int32(name='id'),
        location?: string(name='location'),
        name?: string(name='name'),
        platform?: {
          architecture?: string(name='architecture'),
          os?: string(name='os'),
        }(name='platform'),
        productName?: string(name='productName'),
        productVersion?: string(name='productVersion'),
        productVersionUID?: string(name='productVersionUID'),
        uid?: string(name='uid'),
        vendorType?: string(name='vendorType'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListEnvironmentsResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentsResponseBody(name='body'),
}

async function listEnvironments(request: ListEnvironmentsRequest): ListEnvironmentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentsWithOptions(request, headers, runtime);
}

async function listEnvironmentsWithOptions(request: ListEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.name)) {
    query.name = request.name;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query.fuzzy = request.fuzzy;
  }
  if (!Util.isUnset(request.instanceStatus)) {
    query.instanceStatus = request.instanceStatus;
  }
  if (!Util.isUnset(request.vendorType)) {
    query.vendorType = request.vendorType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvironments', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments`, 'json', req, runtime);
}

model UpdateProductRequest {
  description?: string(name='description'),
}

model UpdateProductResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateProductResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductResponseBody(name='body'),
}

async function updateProduct(uid: string, request: UpdateProductRequest): UpdateProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductWithOptions(uid, request, headers, runtime);
}

async function updateProductWithOptions(uid: string, request: UpdateProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateProduct', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/products/${uid}`, 'json', req, runtime);
}

model ListEnvironmentTunnelResponseBody = {
  errCode?: string(name='errCode', description='错误码'),
  errMsg?: string(name='errMsg', description='错误信息'),
  success?: boolean(name='success', description='是否成功'),
  data?: {
    list?: [ 
      {
        tunnelType?: string(name='tunnelType', description='通道类型'),
        tunnelConfig?: {
          hostname?: string(name='hostname', description='跳板机hostname'),
          sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
          username?: string(name='username', description='跳板机用户名'),
          password?: string(name='password', description='跳板机密码'),
          vpcId?: string(name='vpcId', description='直连vpcId'),
          regionId?: string(name='regionId', description='直连regionId'),
        }(name='tunnelConfig'),
      }
    ](name='list'),
  }(name='data'),
}

model ListEnvironmentTunnelResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvironmentTunnelResponseBody(name='body'),
}

async function listEnvironmentTunnel(uid: string): ListEnvironmentTunnelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvironmentTunnelWithOptions(uid, headers, runtime);
}

async function listEnvironmentTunnelWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentTunnelResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListEnvironmentTunnel', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/tunnels`, 'json', req, runtime);
}

model ListProductVersionEnvironmentResponseBody = {
  data?: {
    list?: [ 
      {
        uid?: string(name='uid', description='uid'),
        envUID?: string(name='envUID', description='env_uid'),
        productVersionUID?: string(name='productVersionUID', description='product_version_uid'),
      }
    ](name='list'),
  }(name='data'),
}

model ListProductVersionEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductVersionEnvironmentResponseBody(name='body'),
}

async function listProductVersionEnvironment(uid: string): ListProductVersionEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionEnvironmentWithOptions(uid, headers, runtime);
}

async function listProductVersionEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionEnvironmentResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListProductVersionEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/environments`, 'json', req, runtime);
}

model DeleteProductVersionConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model DeleteProductVersionConfigResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteProductVersionConfigResponseBody(name='body'),
}

async function deleteProductVersionConfig(uid: string): DeleteProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProductVersionConfigWithOptions(uid, headers, runtime);
}

async function deleteProductVersionConfigWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionConfigResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('DeleteProductVersionConfig', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}

model GetEnvironmentNodeResponseBody = {
  data?: {
    clusterId?: string(name='clusterId'),
    createdAt?: string(name='createdAt'),
    description?: string(name='description'),
    instanceList?: string(name='instanceList'),
    name?: string(name='name'),
    productName?: string(name='productName'),
    productVersion?: string(name='productVersion'),
    uid?: string(name='uid'),
    vendorConfig?: string(name='vendorConfig'),
    vendorType?: string(name='vendorType'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetEnvironmentNodeResponse = {
  headers: map[string]string(name='headers'),
  body: GetEnvironmentNodeResponseBody(name='body'),
}

async function getEnvironmentNode(uid: string): GetEnvironmentNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEnvironmentNodeWithOptions(uid, headers, runtime);
}

async function getEnvironmentNodeWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentNodeResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetEnvironmentNode', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}

model ListProductsRequest {
  pageNum?: int32(name='pageNum'),
  pageSize?: int32(name='pageSize'),
  name?: string(name='name'),
  fuzzy?: string(name='fuzzy'),
}

model ListProductsResponseBody = {
  data?: {
    list?: [ 
      {
        annotations?: {
          shit?: string(name='Shit'),
        }(name='annotations'),
        description?: string(name='description'),
        name?: string(name='name'),
        provider?: string(name='provider'),
        uid?: string(name='uid'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListProductsResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductsResponseBody(name='body'),
}

async function listProducts(request: ListProductsRequest): ListProductsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductsWithOptions(request, headers, runtime);
}

async function listProductsWithOptions(request: ListProductsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.name)) {
    query.name = request.name;
  }
  if (!Util.isUnset(request.fuzzy)) {
    query.fuzzy = request.fuzzy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListProducts', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products`, 'json', req, runtime);
}

model UpdateSnapshotRequest {
  description?: string(name='description'),
  productName?: string(name='productName'),
  productVersion?: string(name='productVersion'),
  productVersionDesc?: string(name='productVersionDesc'),
  updateKey?: string(name='updateKey'),
}

model UpdateSnapshotResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateSnapshotResponseBody(name='body'),
}

async function updateSnapshot(uid: string, request: UpdateSnapshotRequest): UpdateSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSnapshotWithOptions(uid, request, headers, runtime);
}

async function updateSnapshotWithOptions(uid: string, request: UpdateSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.productName)) {
    body.productName = request.productName;
  }
  if (!Util.isUnset(request.productVersion)) {
    body.productVersion = request.productVersion;
  }
  if (!Util.isUnset(request.productVersionDesc)) {
    body.productVersionDesc = request.productVersionDesc;
  }
  if (!Util.isUnset(request.updateKey)) {
    body.updateKey = request.updateKey;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateSnapshot', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}

model CreateEnvironmentSnapshotRequest {
  description?: string(name='description'),
  name?: string(name='name'),
}

model CreateEnvironmentSnapshotResponseBody = {
  data?: {
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model CreateEnvironmentSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: CreateEnvironmentSnapshotResponseBody(name='body'),
}

async function createEnvironmentSnapshot(uid: string, request: CreateEnvironmentSnapshotRequest): CreateEnvironmentSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEnvironmentSnapshotWithOptions(uid, request, headers, runtime);
}

async function createEnvironmentSnapshotWithOptions(uid: string, request: CreateEnvironmentSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentSnapshotResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('CreateEnvironmentSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/snapshots`, 'json', req, runtime);
}

model UpdateProductVersionRelatedFoundationVersionRequest {
  foundationVersionUID?: string(name='foundationVersionUID'),
}

model UpdateProductVersionRelatedFoundationVersionResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateProductVersionRelatedFoundationVersionResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductVersionRelatedFoundationVersionResponseBody(name='body'),
}

async function updateProductVersionRelatedFoundationVersion(uid: string, request: UpdateProductVersionRelatedFoundationVersionRequest): UpdateProductVersionRelatedFoundationVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionRelatedFoundationVersionWithOptions(uid, request, headers, runtime);
}

async function updateProductVersionRelatedFoundationVersionWithOptions(uid: string, request: UpdateProductVersionRelatedFoundationVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionRelatedFoundationVersionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = request.foundationVersionUID,
  };
  return doROARequest('UpdateProductVersionRelatedFoundationVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/foundation`, 'json', req, runtime);
}

model UpdateEnvironmentRequest {
  description?: string(name='description'),
  location?: string(name='location'),
  vendorConfig?: string(name='vendorConfig'),
}

model UpdateEnvironmentResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateEnvironmentResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateEnvironmentResponseBody(name='body'),
}

async function updateEnvironment(uid: string, request: UpdateEnvironmentRequest): UpdateEnvironmentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentWithOptions(uid, request, headers, runtime);
}

async function updateEnvironmentWithOptions(uid: string, request: UpdateEnvironmentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.description)) {
    body.description = request.description;
  }
  if (!Util.isUnset(request.location)) {
    body.location = request.location;
  }
  if (!Util.isUnset(request.vendorConfig)) {
    body.vendorConfig = request.vendorConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateEnvironment', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}

model GetProductComponentDetailResponseBody = {
  data?: {
    appVersion?: string(name='appVersion'),
    category?: string(name='category'),
    childrenComponentVersionList?: [ 
      {
        appVersion?: string(name='appVersion'),
        category?: string(name='category'),
        class?: string(name='class'),
        componentName?: string(name='componentName'),
        componentUID?: string(name='componentUID'),
        description?: string(name='description'),
        documents?: [ string ](name='documents'),
        enable?: boolean(name='enable'),
        imagesMapping?: string(name='imagesMapping'),
        namespace?: string(name='namespace'),
        orchestrationValues?: string(name='orchestrationValues'),
        packageURL?: string(name='packageURL'),
        parentComponent?: boolean(name='parentComponent'),
        priority?: int32(name='priority'),
        productComponentVersionUID?: string(name='productComponentVersionUID'),
        provider?: string(name='provider'),
        readme?: string(name='readme'),
        resources?: string(name='resources'),
        singleton?: boolean(name='singleton'),
        uid?: string(name='uid'),
        version?: string(name='version'),
      }
    ](name='childrenComponentVersionList'),
    class?: string(name='class'),
    componentName?: string(name='componentName'),
    componentUID?: string(name='componentUID'),
    description?: string(name='description'),
    documents?: [ string ](name='documents'),
    enable?: boolean(name='enable'),
    hasDependency?: boolean(name='hasDependency'),
    imagesMapping?: string(name='imagesMapping'),
    namespace?: string(name='namespace'),
    orchestrationValues?: string(name='orchestrationValues'),
    packageURL?: string(name='packageURL'),
    parentComponent?: boolean(name='parentComponent'),
    priority?: int32(name='priority'),
    productComponentVersionUID?: string(name='productComponentVersionUID'),
    provider?: string(name='provider'),
    readme?: string(name='readme'),
    resources?: string(name='resources'),
    singleton?: boolean(name='singleton'),
    uid?: string(name='uid'),
    version?: string(name='version'),
  }(name='data'),
  errCode?: string(name='errCode'),
  success?: boolean(name='success'),
}

model GetProductComponentDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductComponentDetailResponseBody(name='body'),
}

async function getProductComponentDetail(uid: string, versionUID: string, productComponentVersionRelationUID: string): GetProductComponentDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductComponentDetailWithOptions(uid, versionUID, productComponentVersionRelationUID, headers, runtime);
}

async function getProductComponentDetailWithOptions(uid: string, versionUID: string, productComponentVersionRelationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductComponentDetailResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductComponentDetail', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${uid}/versions/${versionUID}/productComponentVersionRelations/${productComponentVersionRelationUID}/detail`, 'json', req, runtime);
}

model ImportEnvironmentNodesRequest {
  nodeListYaml?: string(name='nodeListYaml'),
}

model ImportEnvironmentNodesResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ImportEnvironmentNodesResponse = {
  headers: map[string]string(name='headers'),
  body: ImportEnvironmentNodesResponseBody(name='body'),
}

async function importEnvironmentNodes(uid: string, request: ImportEnvironmentNodesRequest): ImportEnvironmentNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return importEnvironmentNodesWithOptions(uid, request, headers, runtime);
}

async function importEnvironmentNodesWithOptions(uid: string, request: ImportEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ImportEnvironmentNodesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = request.nodeListYaml,
  };
  return doROARequest('ImportEnvironmentNodes', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/importnodes`, 'json', req, runtime);
}

model ListProductVersionsRequest {
  released?: boolean(name='released'),
  platforms?: [ 
    {
      architecture?: string(name='architecture'),
      os?: string(name='os'),
    }
  ](name='platforms'),
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
}

model ListProductVersionsShrinkRequest {
  released?: boolean(name='released'),
  platformsShrink?: string(name='platforms'),
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
}

model ListProductVersionsResponseBody = {
  data?: {
    list?: [ 
      {
        annotations?: {
          additionalProp1?: string(name='additionalProp1'),
          additionalProp2?: string(name='additionalProp2'),
          additionalProp3?: string(name='additionalProp3'),
        }(name='annotations'),
        description?: string(name='description'),
        packageURL?: string(name='packageURL'),
        productName?: string(name='productName'),
        productUID?: string(name='productUID'),
        provider?: string(name='provider'),
        uid?: string(name='uid'),
        version?: string(name='version'),
      }
    ](name='list'),
    pageNum?: int32(name='pageNum'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListProductVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListProductVersionsResponseBody(name='body'),
}

async function listProductVersions(uid: string, request: ListProductVersionsRequest): ListProductVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProductVersionsWithOptions(uid, request, headers, runtime);
}

async function listProductVersionsWithOptions(uid: string, tmpReq: ListProductVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionsResponse {
  Util.validateModel(tmpReq);
  var request = new ListProductVersionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.platforms)) {
    request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
  }
  var query : map[string]any= {};
  if (!Util.isUnset(request.released)) {
    query.released = request.released;
  }
  if (!Util.isUnset(request.platformsShrink)) {
    query.platforms = request.platformsShrink;
  }
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListProductVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products/${uid}/versions`, 'json', req, runtime);
}

model AddEnvironmentPackageHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model AddEnvironmentPackageRequest {
  packageType?: string(name='packageType'),
}

model AddEnvironmentPackageResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model AddEnvironmentPackageResponse = {
  headers: map[string]string(name='headers'),
  body: AddEnvironmentPackageResponseBody(name='body'),
}

async function addEnvironmentPackage(uid: string, request: AddEnvironmentPackageRequest): AddEnvironmentPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddEnvironmentPackageHeaders{};
  return addEnvironmentPackageWithOptions(uid, request, headers, runtime);
}

async function addEnvironmentPackageWithOptions(uid: string, request: AddEnvironmentPackageRequest, headers: AddEnvironmentPackageHeaders, runtime: Util.RuntimeOptions): AddEnvironmentPackageResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.packageType)) {
    query.packageType = request.packageType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('AddEnvironmentPackage', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/package`, 'json', req, runtime);
}

model UpdateEnvironmentProductVersionRequest {
  compatibleVersions?: string(name='compatibleVersions'),
  oldProductVersion?: string(name='oldProductVersion'),
  oldProductVersionUID?: string(name='oldProductVersionUID'),
  productName?: string(name='productName'),
  productUID?: string(name='productUID'),
  productVersion?: string(name='productVersion'),
  productVersionUID?: string(name='productVersionUID'),
}

model UpdateEnvironmentProductVersionResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateEnvironmentProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateEnvironmentProductVersionResponseBody(name='body'),
}

async function updateEnvironmentProductVersion(uid: string, request: UpdateEnvironmentProductVersionRequest): UpdateEnvironmentProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEnvironmentProductVersionWithOptions(uid, request, headers, runtime);
}

async function updateEnvironmentProductVersionWithOptions(uid: string, request: UpdateEnvironmentProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentProductVersionResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.compatibleVersions)) {
    body.compatibleVersions = request.compatibleVersions;
  }
  if (!Util.isUnset(request.oldProductVersion)) {
    body.oldProductVersion = request.oldProductVersion;
  }
  if (!Util.isUnset(request.oldProductVersionUID)) {
    body.oldProductVersionUID = request.oldProductVersionUID;
  }
  if (!Util.isUnset(request.productName)) {
    body.productName = request.productName;
  }
  if (!Util.isUnset(request.productUID)) {
    body.productUID = request.productUID;
  }
  if (!Util.isUnset(request.productVersion)) {
    body.productVersion = request.productVersion;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body.productVersionUID = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateEnvironmentProductVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/product_versions`, 'json', req, runtime);
}

model GetProductVersionResponseBody = {
  data?: {
    description?: string(name='description'),
    provider?: string(name='provider'),
    uid?: string(name='uid'),
    productUID?: string(name='productUID'),
    productName?: string(name='productName'),
    version?: string(name='version'),
    foundationVersionUID?: string(name='foundationVersionUID'),
    packageURL?: string(name='packageURL'),
    platforms?: [
      Platform
    ](name='platforms'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductVersionResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductVersionResponseBody(name='body'),
}

async function getProductVersion(uid: string): GetProductVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductVersionWithOptions(uid, headers, runtime);
}

async function getProductVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProductVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}`, 'json', req, runtime);
}

model SaveEnvironmentParamRequest {
  componentUID?: string(name='componentUID'),
  componentVersionUID?: string(name='componentVersionUID'),
  name?: string(name='name'),
  paramUID?: string(name='paramUID'),
  provider?: string(name='provider'),
  releaseName?: string(name='releaseName'),
  scope?: [ string ](name='scope'),
  value?: string(name='value'),
  notes?: string(name='notes'),
  productVersionUID?: string(name='ProductVersionUID'),
}

model SaveEnvironmentParamResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model SaveEnvironmentParamResponse = {
  headers: map[string]string(name='headers'),
  body: SaveEnvironmentParamResponseBody(name='body'),
}

async function saveEnvironmentParam(uid: string, request: SaveEnvironmentParamRequest): SaveEnvironmentParamResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return saveEnvironmentParamWithOptions(uid, request, headers, runtime);
}

async function saveEnvironmentParamWithOptions(uid: string, request: SaveEnvironmentParamRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SaveEnvironmentParamResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.componentUID)) {
    body.componentUID = request.componentUID;
  }
  if (!Util.isUnset(request.componentVersionUID)) {
    body.componentVersionUID = request.componentVersionUID;
  }
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.paramUID)) {
    body.paramUID = request.paramUID;
  }
  if (!Util.isUnset(request.provider)) {
    body.provider = request.provider;
  }
  if (!Util.isUnset(request.releaseName)) {
    body.releaseName = request.releaseName;
  }
  if (!Util.isUnset(request.scope)) {
    body.scope = request.scope;
  }
  if (!Util.isUnset(request.value)) {
    body.value = request.value;
  }
  if (!Util.isUnset(request.notes)) {
    body.notes = request.notes;
  }
  if (!Util.isUnset(request.productVersionUID)) {
    body.ProductVersionUID = request.productVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('SaveEnvironmentParam', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/params`, 'json', req, runtime);
}

model UpdateSnapshotInstanceJoinOptionRequest {
  joinSnapshot?: boolean(name='joinSnapshot'),
  rootPassword?: string(name='rootPassword'),
}

model UpdateSnapshotInstanceJoinOptionResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model UpdateSnapshotInstanceJoinOptionResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateSnapshotInstanceJoinOptionResponseBody(name='body'),
}

async function updateSnapshotInstanceJoinOption(instanceuid: string, uid: string, request: UpdateSnapshotInstanceJoinOptionRequest): UpdateSnapshotInstanceJoinOptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSnapshotInstanceJoinOptionWithOptions(instanceuid, uid, request, headers, runtime);
}

async function updateSnapshotInstanceJoinOptionWithOptions(instanceuid: string, uid: string, request: UpdateSnapshotInstanceJoinOptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotInstanceJoinOptionResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.joinSnapshot)) {
    body.joinSnapshot = request.joinSnapshot;
  }
  if (!Util.isUnset(request.rootPassword)) {
    body.rootPassword = request.rootPassword;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateSnapshotInstanceJoinOption', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}/instances/${instanceuid}`, 'json', req, runtime);
}

model CreateLicenseRequest {
  effectiveYear?: long(name='effectiveYear', description='expire time'),
}

model CreateLicenseResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model CreateLicenseResponse = {
  headers: map[string]string(name='headers'),
  body: CreateLicenseResponseBody(name='body'),
}

async function createLicense(uid: string, request: CreateLicenseRequest): CreateLicenseResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createLicenseWithOptions(uid, request, headers, runtime);
}

async function createLicenseWithOptions(uid: string, request: CreateLicenseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLicenseResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.effectiveYear)) {
    query.effectiveYear = request.effectiveYear;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('CreateLicense', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/licenses`, 'json', req, runtime);
}

model GetProductResponseBody = {
  data?: {
    description?: string(name='description'),
    name?: string(name='name'),
    provider?: string(name='provider'),
    uid?: string(name='uid'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model GetProductResponse = {
  headers: map[string]string(name='headers'),
  body: GetProductResponseBody(name='body'),
}

async function getProduct(uid: string): GetProductResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProductWithOptions(uid, headers, runtime);
}

async function getProductWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('GetProduct', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products/${uid}`, 'json', req, runtime);
}

model AddProductVersionPackageHeaders {
  commonHeaders?: map[string]string,
  clientToken?: string(name='ClientToken'),
}

model AddProductVersionPackageRequest {
  envUID?: string(name='envUID', description='环境UID（Deprecated)）'),
  packageType?: string(name='packageType', description='ENUM:["full","upgrade"]'),
  packageContentType?: string(name='packageContentType', description='ENUM:["all","base"."application"]'),
}

model AddProductVersionPackageResponseBody = {
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model AddProductVersionPackageResponse = {
  headers: map[string]string(name='headers'),
  body: AddProductVersionPackageResponseBody(name='body'),
}

async function addProductVersionPackage(uid: string, request: AddProductVersionPackageRequest): AddProductVersionPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AddProductVersionPackageHeaders{};
  return addProductVersionPackageWithOptions(uid, request, headers, runtime);
}

async function addProductVersionPackageWithOptions(uid: string, request: AddProductVersionPackageRequest, headers: AddProductVersionPackageHeaders, runtime: Util.RuntimeOptions): AddProductVersionPackageResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.envUID)) {
    query.envUID = request.envUID;
  }
  if (!Util.isUnset(request.packageType)) {
    query.packageType = request.packageType;
  }
  if (!Util.isUnset(request.packageContentType)) {
    query.packageContentType = request.packageContentType;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.clientToken)) {
    realHeaders.ClientToken = headers.clientToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('AddProductVersionPackage', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/hosting/product_versions/${uid}/packages`, 'json', req, runtime);
}

model ListEnvChangeRecordParamsRequest {
  pageNum?: string(name='pageNum'),
  pageSize?: string(name='pageSize'),
  paramType?: string(name='paramType', description='全局参数传global，组件配置传component'),
}

model ListEnvChangeRecordParamsResponseBody = {
  data?: {
    list?: [ 
      {
        name?: string(name='name'),
        value?: string(name='value'),
        description?: string(name='description'),
        componentName?: string(name='componentName'),
        componentReleaseName?: string(name='componentReleaseName'),
        parentComponentName?: string(name='parentComponentName'),
        parentComponentReleaseName?: string(name='parentComponentReleaseName'),
      }
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
}

model ListEnvChangeRecordParamsResponse = {
  headers: map[string]string(name='headers'),
  body: ListEnvChangeRecordParamsResponseBody(name='body'),
}

async function listEnvChangeRecordParams(uid: string, recordUid: string, request: ListEnvChangeRecordParamsRequest): ListEnvChangeRecordParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEnvChangeRecordParamsWithOptions(uid, recordUid, request, headers, runtime);
}

async function listEnvChangeRecordParamsWithOptions(uid: string, recordUid: string, request: ListEnvChangeRecordParamsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordParamsResponse {
  Util.validateModel(request);
  var query : map[string]any= {};
  if (!Util.isUnset(request.pageNum)) {
    query.pageNum = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query.pageSize = request.pageSize;
  }
  if (!Util.isUnset(request.paramType)) {
    query.paramType = request.paramType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  return doROARequest('ListEnvChangeRecordParams', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/params`, 'json', req, runtime);
}

model ListFoundationVersionsResponseBody = {
  data?: {
    list?: [
      FoundationVersion
    ](name='list'),
  }(name='data'),
  errCode?: string(name='errCode'),
  errMsg?: string(name='errMsg'),
  success?: boolean(name='success'),
}

model ListFoundationVersionsResponse = {
  headers: map[string]string(name='headers'),
  body: ListFoundationVersionsResponseBody(name='body'),
}

async function listFoundationVersions(): ListFoundationVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFoundationVersionsWithOptions(headers, runtime);
}

async function listFoundationVersionsWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationVersionsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  return doROARequest('ListFoundationVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions`, 'json', req, runtime);
}

model UpdateProductVersionConfigRequest {
  name?: string(name='name', description='配置信息key'),
  value?: string(name='value', description='配置信息value'),
  notes?: string(name='notes', description='配置说明'),
  componentVersionUID?: string(name='componentVersionUID', description='子组件versinid'),
  parentComponentVersionUID?: string(name='parentComponentVersionUID', description='父组件versionid'),
}

model UpdateProductVersionConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request'),
}

model UpdateProductVersionConfigResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateProductVersionConfigResponseBody(name='body'),
}

async function updateProductVersionConfig(uid: string, request: UpdateProductVersionConfigRequest): UpdateProductVersionConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProductVersionConfigWithOptions(uid, request, headers, runtime);
}

async function updateProductVersionConfigWithOptions(uid: string, request: UpdateProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionConfigResponse {
  Util.validateModel(request);
  var body : map[string]any= {};
  if (!Util.isUnset(request.name)) {
    body.name = request.name;
  }
  if (!Util.isUnset(request.value)) {
    body.value = request.value;
  }
  if (!Util.isUnset(request.notes)) {
    body.notes = request.notes;
  }
  if (!Util.isUnset(request.componentVersionUID)) {
    body.componentVersionUID = request.componentVersionUID;
  }
  if (!Util.isUnset(request.parentComponentVersionUID)) {
    body.parentComponentVersionUID = request.parentComponentVersionUID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  return doROARequest('UpdateProductVersionConfig', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}

